author | tille <tille> | 2002-06-28 17:47:22 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-28 17:47:22 (UTC) |
commit | 8a34a47d873d8d767d0a84a828e6724b73295b8d (patch) (unidiff) | |
tree | aa637b0c3de1315a7d8d11f02f730fb5e00fa52d | |
parent | 54ab82774f52332dbbb97de057ee2b1c5d29347d (diff) | |
download | opie-8a34a47d873d8d767d0a84a828e6724b73295b8d.zip opie-8a34a47d873d8d767d0a84a828e6724b73295b8d.tar.gz opie-8a34a47d873d8d767d0a84a828e6724b73295b8d.tar.bz2 |
it's working! now it's got a license -- it's gpl'd
22 files changed, 197 insertions, 27 deletions
diff --git a/noncore/unsupported/oipkg/installdialog.cpp b/noncore/unsupported/oipkg/installdialog.cpp index bb50103..c676e84 100644 --- a/noncore/unsupported/oipkg/installdialog.cpp +++ b/noncore/unsupported/oipkg/installdialog.cpp | |||
@@ -1,72 +1,73 @@ | |||
1 | /**************************************************************************** | 1 | /*************************************************************************** |
2 | ** Form implementation generated from reading ui file 'installdialog.ui' | 2 | * * |
3 | ** | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | ** Created: Thu May 2 22:19:02 2002 | 4 | * it under the terms of the GNU General Public License as published by * |
5 | ** by: The User Interface Compiler (uic) | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | ** | 6 | * (at your option) any later version. * |
7 | ** WARNING! All changes made in this file will be lost! | 7 | * * |
8 | ****************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
9 | #include "installdialog.h" | 10 | #include "installdialog.h" |
10 | 11 | ||
11 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
12 | #include <qgroupbox.h> | 13 | #include <qgroupbox.h> |
13 | #include <qheader.h> | 14 | #include <qheader.h> |
14 | #include <qlistview.h> | 15 | #include <qlistview.h> |
15 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
16 | #include <qlayout.h> | 17 | #include <qlayout.h> |
17 | #include <qvariant.h> | 18 | #include <qvariant.h> |
18 | #include <qtooltip.h> | 19 | #include <qtooltip.h> |
19 | #include <qwhatsthis.h> | 20 | #include <qwhatsthis.h> |
20 | 21 | ||
21 | 22 | ||
22 | InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const char* name, bool modal, WFlags fl ) | 23 | InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const char* name, bool modal, WFlags fl ) |
23 | : QDialog( parent, name, modal, fl ) | 24 | : QDialog( parent, name, modal, fl ) |
24 | { | 25 | { |
25 | settings = s; | 26 | settings = s; |
26 | if ( !name ) | 27 | if ( !name ) |
27 | setName( "InstallDialog" ); | 28 | setName( "InstallDialog" ); |
28 | resize( 223, 269 ); | 29 | resize( 223, 269 ); |
29 | setCaption( tr( "Install" ) ); | 30 | setCaption( tr( "Install" ) ); |
30 | InstallDialogLayout = new QGridLayout( this ); | 31 | InstallDialogLayout = new QGridLayout( this ); |
31 | InstallDialogLayout->setSpacing( 2 ); | 32 | InstallDialogLayout->setSpacing( 2 ); |
32 | InstallDialogLayout->setMargin( 2 ); | 33 | InstallDialogLayout->setMargin( 2 ); |
33 | 34 | ||
34 | ListViewPackages = new PackageListView( this,"listViewPackages",settings ); | 35 | ListViewPackages = new PackageListView( this,"listViewPackages",settings ); |
35 | 36 | ||
36 | InstallDialogLayout->addWidget( ListViewPackages, 0, 0 ); | 37 | InstallDialogLayout->addWidget( ListViewPackages, 0, 0 ); |
37 | 38 | ||
38 | GroupBoxOptions = new QGroupBox( this, "GroupBoxOptions" ); | 39 | GroupBoxOptions = new QGroupBox( this, "GroupBoxOptions" ); |
39 | GroupBoxOptions->setTitle( tr( "Ipkg options" ) ); | 40 | GroupBoxOptions->setTitle( tr( "Ipkg options" ) ); |
40 | GroupBoxOptions->setColumnLayout(0, Qt::Vertical ); | 41 | GroupBoxOptions->setColumnLayout(0, Qt::Vertical ); |
41 | GroupBoxOptions->layout()->setSpacing( 0 ); | 42 | GroupBoxOptions->layout()->setSpacing( 0 ); |
42 | GroupBoxOptions->layout()->setMargin( 0 ); | 43 | GroupBoxOptions->layout()->setMargin( 0 ); |
43 | GroupBoxOptionsLayout = new QGridLayout( GroupBoxOptions->layout() ); | 44 | GroupBoxOptionsLayout = new QGridLayout( GroupBoxOptions->layout() ); |
44 | GroupBoxOptionsLayout->setAlignment( Qt::AlignTop ); | 45 | GroupBoxOptionsLayout->setAlignment( Qt::AlignTop ); |
45 | GroupBoxOptionsLayout->setSpacing( 2 ); | 46 | GroupBoxOptionsLayout->setSpacing( 2 ); |
46 | GroupBoxOptionsLayout->setMargin( 2 ); | 47 | GroupBoxOptionsLayout->setMargin( 2 ); |
47 | 48 | ||
48 | _force_depends = new QCheckBox( GroupBoxOptions, "_force_depends" ); | 49 | _force_depends = new QCheckBox( GroupBoxOptions, "_force_depends" ); |
49 | QFont _force_depends_font( _force_depends->font() ); | 50 | QFont _force_depends_font( _force_depends->font() ); |
50 | _force_depends_font.setPointSize( 8 ); | 51 | _force_depends_font.setPointSize( 8 ); |
51 | _force_depends->setFont( _force_depends_font ); | 52 | _force_depends->setFont( _force_depends_font ); |
52 | _force_depends->setText( tr( "-force-depends" ) ); | 53 | _force_depends->setText( tr( "-force-depends" ) ); |
53 | //_force_depends->setChecked( true ); | 54 | //_force_depends->setChecked( true ); |
54 | 55 | ||
55 | GroupBoxOptionsLayout->addWidget( _force_depends, 0, 0 ); | 56 | GroupBoxOptionsLayout->addWidget( _force_depends, 0, 0 ); |
56 | 57 | ||
57 | _force_reinstall = new QCheckBox( GroupBoxOptions, "_force_reinstall" ); | 58 | _force_reinstall = new QCheckBox( GroupBoxOptions, "_force_reinstall" ); |
58 | QFont _force_reinstall_font( _force_reinstall->font() ); | 59 | QFont _force_reinstall_font( _force_reinstall->font() ); |
59 | _force_reinstall_font.setPointSize( 8 ); | 60 | _force_reinstall_font.setPointSize( 8 ); |
60 | _force_reinstall->setFont( _force_reinstall_font ); | 61 | _force_reinstall->setFont( _force_reinstall_font ); |
61 | _force_reinstall->setText( tr( "-force-reinstall" ) ); | 62 | _force_reinstall->setText( tr( "-force-reinstall" ) ); |
62 | 63 | ||
63 | GroupBoxOptionsLayout->addWidget( _force_reinstall, 1, 0 ); | 64 | GroupBoxOptionsLayout->addWidget( _force_reinstall, 1, 0 ); |
64 | 65 | ||
65 | _force_remove = new QCheckBox( GroupBoxOptions, "_force_remove" ); | 66 | _force_remove = new QCheckBox( GroupBoxOptions, "_force_remove" ); |
66 | QFont _force_remove_font( _force_remove->font() ); | 67 | QFont _force_remove_font( _force_remove->font() ); |
67 | _force_remove_font.setPointSize( 8 ); | 68 | _force_remove_font.setPointSize( 8 ); |
68 | _force_remove->setFont( _force_remove_font ); | 69 | _force_remove->setFont( _force_remove_font ); |
69 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); | 70 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); |
70 | 71 | ||
71 | GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 ); | 72 | GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 ); |
72 | 73 | ||
diff --git a/noncore/unsupported/oipkg/installdialog.h b/noncore/unsupported/oipkg/installdialog.h index 5af2c35..828c8df 100644 --- a/noncore/unsupported/oipkg/installdialog.h +++ b/noncore/unsupported/oipkg/installdialog.h | |||
@@ -1,47 +1,50 @@ | |||
1 | /**************************************************************************** | 1 | /*************************************************************************** |
2 | ** Form interface generated from reading ui file 'installdialog.ui' | 2 | * * |
3 | ** | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | ** Created: Thu May 2 22:19:01 2002 | 4 | * it under the terms of the GNU General Public License as published by * |
5 | ** by: The User Interface Compiler (uic) | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | ** | 6 | * (at your option) any later version. * |
7 | ** WARNING! All changes made in this file will be lost! | 7 | * * |
8 | ****************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
10 | |||
11 | |||
9 | #ifndef INSTALLDIALOG_H | 12 | #ifndef INSTALLDIALOG_H |
10 | #define INSTALLDIALOG_H | 13 | #define INSTALLDIALOG_H |
11 | 14 | ||
12 | #include "pksettings.h" | 15 | #include "pksettings.h" |
13 | #include "packagelistview.h" | 16 | #include "packagelistview.h" |
14 | #include <qvariant.h> | 17 | #include <qvariant.h> |
15 | #include <qdialog.h> | 18 | #include <qdialog.h> |
16 | class QVBoxLayout; | 19 | class QVBoxLayout; |
17 | class QHBoxLayout; | 20 | class QHBoxLayout; |
18 | class QGridLayout; | 21 | class QGridLayout; |
19 | class QCheckBox; | 22 | class QCheckBox; |
20 | class QGroupBox; | 23 | class QGroupBox; |
21 | class QListView; | 24 | class QListView; |
22 | class QListViewItem; | 25 | class QListViewItem; |
23 | 26 | ||
24 | class InstallDialog : public QDialog | 27 | class InstallDialog : public QDialog |
25 | { | 28 | { |
26 | Q_OBJECT | 29 | Q_OBJECT |
27 | 30 | ||
28 | public: InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 31 | public: InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
29 | ~InstallDialog(); | 32 | ~InstallDialog(); |
30 | 33 | ||
31 | PackageListView* ListViewPackages; | 34 | PackageListView* ListViewPackages; |
32 | QGroupBox* GroupBoxOptions; | 35 | QGroupBox* GroupBoxOptions; |
33 | QCheckBox* _force_depends; | 36 | QCheckBox* _force_depends; |
34 | QCheckBox* _force_reinstall; | 37 | QCheckBox* _force_reinstall; |
35 | QCheckBox* _force_remove; | 38 | QCheckBox* _force_remove; |
36 | QCheckListItem *toRemoveItem; | 39 | QCheckListItem *toRemoveItem; |
37 | QCheckListItem *toInstallItem; | 40 | QCheckListItem *toInstallItem; |
38 | 41 | ||
39 | protected: | 42 | protected: |
40 | QGridLayout* InstallDialogLayout; | 43 | QGridLayout* InstallDialogLayout; |
41 | QGridLayout* GroupBoxOptionsLayout; | 44 | QGridLayout* GroupBoxOptionsLayout; |
42 | bool event( QEvent* ); | 45 | bool event( QEvent* ); |
43 | private: | 46 | private: |
44 | PackageManagerSettings* settings; | 47 | PackageManagerSettings* settings; |
45 | }; | 48 | }; |
46 | 49 | ||
47 | #endif // INSTALLDIALOG_H | 50 | #endif // INSTALLDIALOG_H |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 8778b85..084900d 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,110 +1,120 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // Copyright (C) 2000 Trolltech AS. | ||
1 | // adadpted form qpe/qipkg | 10 | // adadpted form qpe/qipkg |
11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
2 | 12 | ||
3 | 13 | ||
4 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
5 | 15 | ||
6 | #include <qpe/qpemenubar.h> | 16 | #include <qpe/qpemenubar.h> |
7 | #include <qpe/qpemessagebox.h> | 17 | #include <qpe/qpemessagebox.h> |
8 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
9 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
10 | #include <qpe/qpetoolbar.h> | 20 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qaction.h> | 22 | #include <qaction.h> |
13 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
14 | #include <qpopupmenu.h> | 24 | #include <qpopupmenu.h> |
15 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
16 | #include <qstring.h> | 26 | #include <qstring.h> |
17 | #include <qlabel.h> | 27 | #include <qlabel.h> |
18 | #include <qfile.h> | 28 | #include <qfile.h> |
19 | #include <qlistview.h> | 29 | #include <qlistview.h> |
20 | #include <qtextview.h> | 30 | #include <qtextview.h> |
21 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
22 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
23 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
24 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
25 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
26 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
27 | #include <qlayout.h> | 37 | #include <qlayout.h> |
28 | 38 | ||
29 | #include "pksettingsbase.h" | 39 | #include "pksettingsbase.h" |
30 | #include "utils.h" | 40 | #include "utils.h" |
31 | #include "packagelistitem.h" | 41 | #include "packagelistitem.h" |
32 | 42 | ||
33 | 43 | ||
34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
35 | QMainWindow( parent, name, f ) | 45 | QMainWindow( parent, name, f ) |
36 | // packageListServers( QObject(parent), name ), | 46 | // packageListServers( QObject(parent), name ), |
37 | // packageListSearch( parent, name ), | 47 | // packageListSearch( parent, name ), |
38 | // packageListDocLnk( parent, name ) | 48 | // packageListDocLnk( parent, name ) |
39 | { | 49 | { |
40 | setCaption( tr("Package Manager") ); | 50 | setCaption( tr("Package Manager") ); |
41 | settings = new PackageManagerSettings(this,0,TRUE); | 51 | settings = new PackageManagerSettings(this,0,TRUE); |
42 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 52 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
43 | setCentralWidget( listViewPackages ); | 53 | setCentralWidget( listViewPackages ); |
44 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 54 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
45 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 55 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); |
46 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 56 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
47 | ipkg = new PmIpkg( settings, this ); | 57 | ipkg = new PmIpkg( settings, this ); |
48 | packageListServers.setSettings( settings ); | 58 | packageListServers.setSettings( settings ); |
49 | packageListSearch.setSettings( settings ); | 59 | packageListSearch.setSettings( settings ); |
50 | packageListDocLnk.setSettings( settings ); | 60 | packageListDocLnk.setSettings( settings ); |
51 | pvDebug(9,"packageListServers.update"); | 61 | pvDebug(9,"packageListServers.update"); |
52 | packageListServers.update(); | 62 | packageListServers.update(); |
53 | pvDebug(9,"packageListDocLnk.update"); | 63 | pvDebug(9,"packageListDocLnk.update"); |
54 | pvDebug(0,"no UPDATE of DocLnk"); | 64 | pvDebug(0,"no UPDATE of DocLnk"); |
55 | packageListDocLnk.update(); | 65 | packageListDocLnk.update(); |
56 | pvDebug(9,"makeMenu"); | 66 | pvDebug(9,"makeMenu"); |
57 | makeMenu(); | 67 | makeMenu(); |
58 | makeChannel(); | 68 | makeChannel(); |
59 | //opie is hardcoded default ;) | 69 | //opie is hardcoded default ;) |
60 | //pvDebug(9,"section->setCurrentItem"); | 70 | //pvDebug(9,"section->setCurrentItem"); |
61 | // for (int i=0;i<section->count();i++) | 71 | // for (int i=0;i<section->count();i++) |
62 | // if (section->text(i)=="opie") | 72 | // if (section->text(i)=="opie") |
63 | // section->setCurrentItem(i); | 73 | // section->setCurrentItem(i); |
64 | // sectionChanged(); | 74 | // sectionChanged(); |
65 | 75 | ||
66 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 76 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
67 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 77 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
68 | 78 | ||
69 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 79 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
70 | SLOT(removeLinks()) ); | 80 | SLOT(removeLinks()) ); |
71 | connect( settings->createLinksButton, SIGNAL( clicked()), | 81 | connect( settings->createLinksButton, SIGNAL( clicked()), |
72 | SLOT(createLinks()) ); | 82 | SLOT(createLinks()) ); |
73 | 83 | ||
74 | pvDebug(9,"displayList"); | 84 | pvDebug(9,"displayList"); |
75 | displayList(); | 85 | displayList(); |
76 | } | 86 | } |
77 | 87 | ||
78 | void MainWindow::makeMenu() | 88 | void MainWindow::makeMenu() |
79 | { | 89 | { |
80 | 90 | ||
81 | QPEToolBar *toolBar = new QPEToolBar( this ); | 91 | QPEToolBar *toolBar = new QPEToolBar( this ); |
82 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 92 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
83 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 93 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
84 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 94 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
85 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 95 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
86 | QPopupMenu *helpMenu = new QPopupMenu( menuBar ); | 96 | QPopupMenu *helpMenu = new QPopupMenu( menuBar ); |
87 | 97 | ||
88 | setToolBarsMovable( false ); | 98 | setToolBarsMovable( false ); |
89 | toolBar->setHorizontalStretchable( true ); | 99 | toolBar->setHorizontalStretchable( true ); |
90 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 100 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
91 | menuBar->insertItem( tr( "View" ), viewMenu ); | 101 | menuBar->insertItem( tr( "View" ), viewMenu ); |
92 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 102 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
93 | menuBar->insertItem( tr( "Help" ), helpMenu ); | 103 | menuBar->insertItem( tr( "Help" ), helpMenu ); |
94 | 104 | ||
95 | QLabel *spacer; | 105 | QLabel *spacer; |
96 | // spacer = new QLabel( "", toolBar ); | 106 | // spacer = new QLabel( "", toolBar ); |
97 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); | 107 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); |
98 | // toolBar->setStretchableWidget( spacer ); | 108 | // toolBar->setStretchableWidget( spacer ); |
99 | 109 | ||
100 | 110 | ||
101 | runAction = new QAction( tr( "Apply" ), | 111 | runAction = new QAction( tr( "Apply" ), |
102 | Resource::loadPixmap( "oipkg/install" ), | 112 | Resource::loadPixmap( "oipkg/install" ), |
103 | QString::null, 0, this, 0 ); | 113 | QString::null, 0, this, 0 ); |
104 | connect( runAction, SIGNAL( activated() ), | 114 | connect( runAction, SIGNAL( activated() ), |
105 | this, SLOT( runIpkg() ) ); | 115 | this, SLOT( runIpkg() ) ); |
106 | runAction->addTo( toolBar ); | 116 | runAction->addTo( toolBar ); |
107 | runAction->addTo( srvMenu ); | 117 | runAction->addTo( srvMenu ); |
108 | 118 | ||
109 | srvMenu->insertSeparator(); | 119 | srvMenu->insertSeparator(); |
110 | 120 | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 4a5e8bf..090ddd3 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -1,64 +1,76 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // Copyright (C) 2000 Trolltech AS. | ||
10 | // adadpted form qpe/qipkg | ||
11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
12 | |||
1 | #ifndef MAINWINDOW_H | 13 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 14 | #define MAINWINDOW_H |
3 | 15 | ||
4 | #include <qmainwindow.h> | 16 | #include <qmainwindow.h> |
5 | #include <qaction.h> | 17 | #include <qaction.h> |
6 | #include <qtimer.h> | 18 | #include <qtimer.h> |
7 | #include <qpopupmenu.h> | 19 | #include <qpopupmenu.h> |
8 | 20 | ||
9 | #include "packagelist.h" | 21 | #include "packagelist.h" |
10 | #include "packagelistremote.h" | 22 | #include "packagelistremote.h" |
11 | #include "packagelistlocal.h" | 23 | #include "packagelistlocal.h" |
12 | #include "packagelistdoclnk.h" | 24 | #include "packagelistdoclnk.h" |
13 | #include "pmipkg.h" | 25 | #include "pmipkg.h" |
14 | #include "pksettings.h" | 26 | #include "pksettings.h" |
15 | #include "packagelistview.h" | 27 | #include "packagelistview.h" |
16 | 28 | ||
17 | class QComboBox; | 29 | class QComboBox; |
18 | class QPEToolBar; | 30 | class QPEToolBar; |
19 | class QLineEdit; | 31 | class QLineEdit; |
20 | class PackageListItem; | 32 | class PackageListItem; |
21 | class QCopChannel; | 33 | class QCopChannel; |
22 | class QMessageBox; | 34 | class QMessageBox; |
23 | class QCheckBox; | 35 | class QCheckBox; |
24 | 36 | ||
25 | class MainWindow : public QMainWindow | 37 | class MainWindow : public QMainWindow |
26 | { | 38 | { |
27 | Q_OBJECT | 39 | Q_OBJECT |
28 | 40 | ||
29 | 41 | ||
30 | public: | 42 | public: |
31 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 43 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
32 | ~MainWindow(); | 44 | ~MainWindow(); |
33 | void makeChannel(); | 45 | void makeChannel(); |
34 | 46 | ||
35 | QCopChannel *channel; | 47 | QCopChannel *channel; |
36 | 48 | ||
37 | protected slots: | 49 | protected slots: |
38 | void runIpkg(); | 50 | void runIpkg(); |
39 | void updateList(); | 51 | void updateList(); |
40 | void displayList(); | 52 | void displayList(); |
41 | void subSectionChanged(); | 53 | void subSectionChanged(); |
42 | void sectionChanged(); | 54 | void sectionChanged(); |
43 | void showSettings(); | 55 | void showSettings(); |
44 | void showSettingsSrv(); | 56 | void showSettingsSrv(); |
45 | void showSettingsDst(); | 57 | void showSettingsDst(); |
46 | 58 | ||
47 | public slots: | 59 | public slots: |
48 | void sectionClose(); | 60 | void sectionClose(); |
49 | void sectionShow(bool); | 61 | void sectionShow(bool); |
50 | void findClose(); | 62 | void findClose(); |
51 | void findShow(bool); | 63 | void findShow(bool); |
52 | void searchClose(); | 64 | void searchClose(); |
53 | void searchShow(bool); | 65 | void searchShow(bool); |
54 | void destClose(); | 66 | void destClose(); |
55 | void destShow(bool); | 67 | void destShow(bool); |
56 | void filterList(); | 68 | void filterList(); |
57 | void createLinks(); | 69 | void createLinks(); |
58 | void removeLinks(); | 70 | void removeLinks(); |
59 | void receive (const QCString &, const QByteArray &); | 71 | void receive (const QCString &, const QByteArray &); |
60 | void setDocument (const QString &); | 72 | void setDocument (const QString &); |
61 | void remotePackageQuery(); | 73 | void remotePackageQuery(); |
62 | 74 | ||
63 | private: | 75 | private: |
64 | void makeMenu(); | 76 | void makeMenu(); |
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 0cd93bf..7aaa240 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "package.h" | 10 | #include "package.h" |
2 | 11 | ||
3 | #include <qpe/process.h> | 12 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 13 | #include <qpe/stringutil.h> |
5 | #include <qfile.h> | 14 | #include <qfile.h> |
6 | #include <qtextstream.h> | 15 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 16 | #include <stdlib.h> |
8 | #include <unistd.h> | 17 | #include <unistd.h> |
9 | 18 | ||
10 | #include "debug.h" | 19 | #include "debug.h" |
11 | 20 | ||
12 | Package::Package( QObject *parent, const char *name ) | 21 | Package::Package( QObject *parent, const char *name ) |
13 | : QObject(parent,name) | 22 | : QObject(parent,name) |
14 | { | 23 | { |
15 | 24 | ||
16 | } | 25 | } |
17 | 26 | ||
18 | Package::~Package() | 27 | Package::~Package() |
19 | { | 28 | { |
20 | } | 29 | } |
21 | 30 | ||
22 | Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) | 31 | Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) |
23 | : QObject(parent,name) | 32 | : QObject(parent,name) |
24 | { | 33 | { |
25 | Package(parent,name); | 34 | Package(parent,name); |
26 | init(s); | 35 | init(s); |
27 | } | 36 | } |
28 | 37 | ||
29 | void Package::init( PackageManagerSettings *s ) | 38 | void Package::init( PackageManagerSettings *s ) |
30 | { | 39 | { |
31 | settings = s; | 40 | settings = s; |
32 | _size = ""; | 41 | _size = ""; |
33 | _section = ""; | 42 | _section = ""; |
34 | _subsection = ""; | 43 | _subsection = ""; |
35 | _shortDesc = ""; | 44 | _shortDesc = ""; |
36 | _desc = ""; | 45 | _desc = ""; |
37 | _name = ""; | 46 | _name = ""; |
38 | _toProcess = false; | 47 | _toProcess = false; |
39 | _useFileName = false; | 48 | _useFileName = false; |
40 | _old = false; | 49 | _old = false; |
41 | _status = ""; | 50 | _status = ""; |
42 | _dest = settings->getDestinationName(); | 51 | _dest = settings->getDestinationName(); |
43 | _link = settings->createLinks(); | 52 | _link = settings->createLinks(); |
44 | _versions=0; | 53 | _versions=0; |
45 | _version=""; | 54 | _version=""; |
46 | } | 55 | } |
47 | 56 | ||
48 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) | 57 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) |
49 | : QObject(parent,name) | 58 | : QObject(parent,name) |
50 | { | 59 | { |
51 | init(s); | 60 | init(s); |
52 | parsePackage( pack ); | 61 | parsePackage( pack ); |
53 | } | 62 | } |
54 | 63 | ||
55 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) | 64 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) |
56 | : QObject(parent,name) | 65 | : QObject(parent,name) |
57 | { | 66 | { |
58 | init(s); | 67 | init(s); |
59 | if ( !QFile::exists( n ) ) | 68 | if ( !QFile::exists( n ) ) |
60 | { | 69 | { |
61 | _name = QString( n ); | 70 | _name = QString( n ); |
62 | }else{ | 71 | }else{ |
63 | pvDebug(4,"remote file: "+n); | 72 | pvDebug(4,"remote file: "+n); |
64 | parseIpkgFile( n ); | 73 | parseIpkgFile( n ); |
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 0f76ece..c147420 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PK_ITEM_H | 10 | #ifndef PK_ITEM_H |
2 | #define PK_ITEM_H | 11 | #define PK_ITEM_H |
3 | 12 | ||
4 | #include <qstring.h> | 13 | #include <qstring.h> |
5 | #include <qlistview.h> | 14 | #include <qlistview.h> |
6 | #include <qpainter.h> | 15 | #include <qpainter.h> |
7 | #include <qpixmap.h> | 16 | #include <qpixmap.h> |
8 | #include <qdict.h> | 17 | #include <qdict.h> |
9 | #include <qobject.h> | 18 | #include <qobject.h> |
10 | 19 | ||
11 | #include "pksettings.h" | 20 | #include "pksettings.h" |
12 | 21 | ||
13 | class Package : public QObject | 22 | class Package : public QObject |
14 | { | 23 | { |
15 | Q_OBJECT | 24 | Q_OBJECT |
16 | public: | 25 | public: |
17 | Package(QObject *parent=0, const char *name=0); | 26 | Package(QObject *parent=0, const char *name=0); |
18 | Package(PackageManagerSettings *s, QObject *parent=0, const char *name=0); | 27 | Package(PackageManagerSettings *s, QObject *parent=0, const char *name=0); |
19 | ~Package(); | 28 | ~Package(); |
20 | Package( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); | 29 | Package( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); |
21 | Package( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); | 30 | Package( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); |
22 | Package( Package*s, QObject *parent=0, const char *name=0 ); | 31 | Package( Package*s, QObject *parent=0, const char *name=0 ); |
23 | 32 | ||
24 | void setValue( QString, QString ); | 33 | void setValue( QString, QString ); |
25 | void copyValues( Package* ); | 34 | void copyValues( Package* ); |
26 | 35 | ||
27 | QString name(); | 36 | QString name(); |
28 | QString installName(); | 37 | QString installName(); |
29 | QString packageName(); | 38 | QString packageName(); |
30 | bool installed(); | 39 | bool installed(); |
31 | bool otherInstalled(); | 40 | bool otherInstalled(); |
32 | 41 | ||
33 | void setDesc( QString ); | 42 | void setDesc( QString ); |
34 | QString shortDesc(); | 43 | QString shortDesc(); |
35 | QString desc(); | 44 | QString desc(); |
36 | QString size(); | 45 | QString size(); |
37 | QString sizeUnits(); | 46 | QString sizeUnits(); |
38 | QString version(); | 47 | QString version(); |
39 | void setSection( QString ); | 48 | void setSection( QString ); |
40 | QString section(); | 49 | QString section(); |
41 | QString subSection(); | 50 | QString subSection(); |
42 | QString details(); | 51 | QString details(); |
43 | bool toProcess(); | 52 | bool toProcess(); |
44 | bool toInstall(); | 53 | bool toInstall(); |
45 | bool toRemove(); | 54 | bool toRemove(); |
46 | void processed(); | 55 | void processed(); |
47 | QString dest(); | 56 | QString dest(); |
48 | void setDest( QString d ); | 57 | void setDest( QString d ); |
49 | void setOn(); | 58 | void setOn(); |
50 | bool link(); | 59 | bool link(); |
51 | void setLink(bool); | 60 | void setLink(bool); |
52 | bool isOld(); | 61 | bool isOld(); |
53 | bool hasVersions(); | 62 | bool hasVersions(); |
54 | void parseIpkgFile( QString ); | 63 | void parseIpkgFile( QString ); |
55 | void instalFromFile(bool iff=true); | 64 | void instalFromFile(bool iff=true); |
56 | void setName(QString); | 65 | void setName(QString); |
57 | QDict<QString>* getFields(); | 66 | QDict<QString>* getFields(); |
58 | QString status(); | 67 | QString status(); |
59 | 68 | ||
60 | QDict<Package>* getOtherVersions(); | 69 | QDict<Package>* getOtherVersions(); |
61 | void setOtherVersions(QDict<Package>*); | 70 | void setOtherVersions(QDict<Package>*); |
62 | 71 | ||
63 | public slots: | 72 | public slots: |
64 | void toggleProcess(); | 73 | void toggleProcess(); |
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index e445570..f6c4c37 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "packagelist.h" | 10 | #include "packagelist.h" |
2 | 11 | ||
3 | #include <assert.h> | 12 | #include <assert.h> |
4 | #include <qfile.h> | 13 | #include <qfile.h> |
5 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
6 | #include <qtextstream.h> | 15 | #include <qtextstream.h> |
7 | 16 | ||
8 | #include "debug.h" | 17 | #include "debug.h" |
9 | 18 | ||
10 | static QDict<Package> *packageListAll; | 19 | static QDict<Package> *packageListAll; |
11 | static int packageListAllRefCount = 0; | 20 | static int packageListAllRefCount = 0; |
12 | 21 | ||
13 | PackageList::PackageList(QObject *parent, const char *name) | 22 | PackageList::PackageList(QObject *parent, const char *name) |
14 | : QObject(parent,name), packageIter( packageList ) | 23 | : QObject(parent,name), packageIter( packageList ) |
15 | { | 24 | { |
16 | empty=true; | 25 | empty=true; |
17 | if (!packageListAll) packageListAll = new QDict<Package>(); | 26 | if (!packageListAll) packageListAll = new QDict<Package>(); |
18 | packageListAllRefCount++; | 27 | packageListAllRefCount++; |
19 | sections << "All"; | 28 | sections << "All"; |
20 | subSections.insert("All", new QStringList() ); | 29 | subSections.insert("All", new QStringList() ); |
21 | QStringList *ss = subSections["All"]; | 30 | QStringList *ss = subSections["All"]; |
22 | *ss << "All"; | 31 | *ss << "All"; |
23 | aktSection = "All"; | 32 | aktSection = "All"; |
24 | aktSubSection = "All"; | 33 | aktSubSection = "All"; |
25 | } | 34 | } |
26 | 35 | ||
27 | PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name) | 36 | PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name) |
28 | : QObject(parent,name), packageIter( packageList ) | 37 | : QObject(parent,name), packageIter( packageList ) |
29 | { | 38 | { |
30 | settings = s; | 39 | settings = s; |
31 | PackageList(parent, name); | 40 | PackageList(parent, name); |
32 | } | 41 | } |
33 | 42 | ||
34 | PackageList::~PackageList() | 43 | PackageList::~PackageList() |
35 | { | 44 | { |
36 | if (--packageListAllRefCount < 1 ) delete packageListAll; | 45 | if (--packageListAllRefCount < 1 ) delete packageListAll; |
37 | } | 46 | } |
38 | 47 | ||
39 | /** Inserts a package into the list */ | 48 | /** Inserts a package into the list */ |
40 | void PackageList::insertPackage( Package* pack ) | 49 | void PackageList::insertPackage( Package* pack ) |
41 | { | 50 | { |
42 | if (!pack) return; | 51 | if (!pack) return; |
43 | Package* p = packageListAll->find( pack->name() ); | 52 | Package* p = packageListAll->find( pack->name() ); |
44 | if ( p ) | 53 | if ( p ) |
45 | { | 54 | { |
46 | if ( (p->version() == pack->version()) | 55 | if ( (p->version() == pack->version()) |
47 | // && (p->dest() == pack->dest()) | 56 | // && (p->dest() == pack->dest()) |
48 | ) | 57 | ) |
49 | { | 58 | { |
50 | p->copyValues( pack ); | 59 | p->copyValues( pack ); |
51 | delete pack; | 60 | delete pack; |
52 | pack = p; | 61 | pack = p; |
53 | } else { | 62 | } else { |
54 | QDict<Package> *packver = p->getOtherVersions(); | 63 | QDict<Package> *packver = p->getOtherVersions(); |
55 | // p->setName( pack->name()+"["+p->version()+"]" ); | 64 | // p->setName( pack->name()+"["+p->version()+"]" ); |
56 | if (!packver) | 65 | if (!packver) |
57 | { | 66 | { |
58 | packver = new QDict<Package>(); | 67 | packver = new QDict<Package>(); |
59 | packver->insert( pack->name(), p ); | 68 | packver->insert( pack->name(), p ); |
60 | p->setOtherVersions( packver ); | 69 | p->setOtherVersions( packver ); |
61 | } | 70 | } |
62 | pack->setName( pack->name()+"["+pack->version()+"]" ); | 71 | pack->setName( pack->name()+"["+pack->version()+"]" ); |
63 | pack->setOtherVersions( packver ); | 72 | pack->setOtherVersions( packver ); |
64 | packver->insert( pack->name(), pack ); | 73 | packver->insert( pack->name(), pack ); |
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h index 46a00e9..0c13688 100644 --- a/noncore/unsupported/oipkg/packagelist.h +++ b/noncore/unsupported/oipkg/packagelist.h | |||
@@ -1,60 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PACKAGELIST_H | 10 | #ifndef PACKAGELIST_H |
2 | #define PACKAGELIST_H | 11 | #define PACKAGELIST_H |
3 | 12 | ||
4 | #include <qdict.h> | 13 | #include <qdict.h> |
5 | #include "package.h" | 14 | #include "package.h" |
6 | #include "pksettings.h" | 15 | #include "pksettings.h" |
7 | #include "debug.h" | 16 | #include "debug.h" |
8 | 17 | ||
9 | class PackageList : public QObject | 18 | class PackageList : public QObject |
10 | { | 19 | { |
11 | Q_OBJECT | 20 | Q_OBJECT |
12 | public: | 21 | public: |
13 | //static QString all = QObject::tr("All"); | 22 | //static QString all = QObject::tr("All"); |
14 | 23 | ||
15 | PackageList (QObject *parent=0, const char *name=0); | 24 | PackageList (QObject *parent=0, const char *name=0); |
16 | PackageList( PackageManagerSettings *s, QObject *parent=0, const char *name=0); | 25 | PackageList( PackageManagerSettings *s, QObject *parent=0, const char *name=0); |
17 | virtual ~PackageList(); | 26 | virtual ~PackageList(); |
18 | void insertPackage( Package* ); | 27 | void insertPackage( Package* ); |
19 | Package* find( QString ); | 28 | Package* find( QString ); |
20 | Package* next(); | 29 | Package* next(); |
21 | Package* first(); | 30 | Package* first(); |
22 | 31 | ||
23 | QStringList getSections(); | 32 | QStringList getSections(); |
24 | QStringList getSubSections(); | 33 | QStringList getSubSections(); |
25 | void setSettings( PackageManagerSettings* ); | 34 | void setSettings( PackageManagerSettings* ); |
26 | void filterPackages( QString ); | 35 | void filterPackages( QString ); |
27 | Package* getByName( QString ); | 36 | Package* getByName( QString ); |
28 | void clear(); | 37 | void clear(); |
29 | void allPackages(); | 38 | void allPackages(); |
30 | 39 | ||
31 | QDict<Package> *versions; | 40 | QDict<Package> *versions; |
32 | 41 | ||
33 | public slots: | 42 | public slots: |
34 | void setSection(QString); | 43 | void setSection(QString); |
35 | void setSubSection(QString); | 44 | void setSubSection(QString); |
36 | // virtual void update(); | 45 | // virtual void update(); |
37 | 46 | ||
38 | protected: | 47 | protected: |
39 | int currentPackage; | 48 | int currentPackage; |
40 | int packageCount; | 49 | int packageCount; |
41 | 50 | ||
42 | PackageManagerSettings *settings; | 51 | PackageManagerSettings *settings; |
43 | QDict<Package> packageList; | 52 | QDict<Package> packageList; |
44 | QDict<Package> origPackageList; | 53 | QDict<Package> origPackageList; |
45 | QDictIterator<Package> packageIter; | 54 | QDictIterator<Package> packageIter; |
46 | 55 | ||
47 | bool empty; | 56 | bool empty; |
48 | QString aktSection; | 57 | QString aktSection; |
49 | QString aktSubSection; | 58 | QString aktSubSection; |
50 | QStringList sections; | 59 | QStringList sections; |
51 | QDict<QStringList> subSections; | 60 | QDict<QStringList> subSections; |
52 | QDict<bool> sectionsDict; | 61 | QDict<bool> sectionsDict; |
53 | 62 | ||
54 | 63 | ||
55 | void updateSections( Package* ); | 64 | void updateSections( Package* ); |
56 | void readFileEntries( QString file, QString dest="" ); | 65 | void readFileEntries( QString file, QString dest="" ); |
57 | }; | 66 | }; |
58 | 67 | ||
59 | 68 | ||
60 | #endif | 69 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp index deb8a6d..76e91ff 100644 --- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp | |||
@@ -1,45 +1,53 @@ | |||
1 | 1 | /*************************************************************************** | |
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
2 | #include "packagelistdoclnk.h" | 10 | #include "packagelistdoclnk.h" |
3 | 11 | ||
4 | #include <qpe/applnk.h> | 12 | #include <qpe/applnk.h> |
5 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
6 | #include <qlist.h> | 14 | #include <qlist.h> |
7 | 15 | ||
8 | #include "package.h" | 16 | #include "package.h" |
9 | #include "pksettings.h" | 17 | #include "pksettings.h" |
10 | 18 | ||
11 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent, const char *name) | 19 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent, const char *name) |
12 | : PackageList(s) | 20 | : PackageList(s) |
13 | { | 21 | { |
14 | PackageListDocLnk(parent, name); | 22 | PackageListDocLnk(parent, name); |
15 | } | 23 | } |
16 | 24 | ||
17 | PackageListDocLnk::PackageListDocLnk(QObject *parent, const char *name) | 25 | PackageListDocLnk::PackageListDocLnk(QObject *parent, const char *name) |
18 | : PackageList(parent, name) | 26 | : PackageList(parent, name) |
19 | { | 27 | { |
20 | Config cfg( "oipkg", Config::User ); | 28 | Config cfg( "oipkg", Config::User ); |
21 | cfg.setGroup( "Common" ); | 29 | cfg.setGroup( "Common" ); |
22 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); | 30 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); |
23 | pvDebug(2,"opening DocLnkSet "+docLnkDir); | 31 | pvDebug(2,"opening DocLnkSet "+docLnkDir); |
24 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); | 32 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); |
25 | } | 33 | } |
26 | 34 | ||
27 | PackageListDocLnk::~PackageListDocLnk() | 35 | PackageListDocLnk::~PackageListDocLnk() |
28 | { | 36 | { |
29 | Config cfg( "oipkg", Config::User ); | 37 | Config cfg( "oipkg", Config::User ); |
30 | cfg.setGroup( "Common" ); | 38 | cfg.setGroup( "Common" ); |
31 | cfg.writeEntry( "docLnkDir", docLnkDir ); | 39 | cfg.writeEntry( "docLnkDir", docLnkDir ); |
32 | delete doclnkset; | 40 | delete doclnkset; |
33 | } | 41 | } |
34 | 42 | ||
35 | 43 | ||
36 | 44 | ||
37 | void PackageListDocLnk::update() | 45 | void PackageListDocLnk::update() |
38 | { | 46 | { |
39 | pvDebug(2,"PackageListDocLnk::update "); | 47 | pvDebug(2,"PackageListDocLnk::update "); |
40 | QList<DocLnk> packlist = doclnkset->children(); | 48 | QList<DocLnk> packlist = doclnkset->children(); |
41 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) | 49 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) |
42 | { | 50 | { |
43 | insertPackage( new Package(pack->file(), settings ) ); | 51 | insertPackage( new Package(pack->file(), settings ) ); |
44 | } | 52 | } |
45 | } | 53 | } |
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.h b/noncore/unsupported/oipkg/packagelistdoclnk.h index a63fb59..af06a45 100644 --- a/noncore/unsupported/oipkg/packagelistdoclnk.h +++ b/noncore/unsupported/oipkg/packagelistdoclnk.h | |||
@@ -1,23 +1,32 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PACKAGELISTDOCLNK_H | 10 | #ifndef PACKAGELISTDOCLNK_H |
2 | #define PACKAGELISTDOCLNK_H | 11 | #define PACKAGELISTDOCLNK_H |
3 | 12 | ||
4 | #include "packagelist.h" | 13 | #include "packagelist.h" |
5 | #include "debug.h" | 14 | #include "debug.h" |
6 | 15 | ||
7 | class DocLnkSet; | 16 | class DocLnkSet; |
8 | 17 | ||
9 | class PackageListDocLnk : public PackageList | 18 | class PackageListDocLnk : public PackageList |
10 | { | 19 | { |
11 | public: | 20 | public: |
12 | PackageListDocLnk(QObject *parent=0, const char *name=0); | 21 | PackageListDocLnk(QObject *parent=0, const char *name=0); |
13 | PackageListDocLnk( PackageManagerSettings *s, QObject *parent=0, const char *name=0); | 22 | PackageListDocLnk( PackageManagerSettings *s, QObject *parent=0, const char *name=0); |
14 | virtual ~PackageListDocLnk(); | 23 | virtual ~PackageListDocLnk(); |
15 | public slots: | 24 | public slots: |
16 | void update(); | 25 | void update(); |
17 | private: | 26 | private: |
18 | DocLnkSet *doclnkset; | 27 | DocLnkSet *doclnkset; |
19 | QString docLnkDir; | 28 | QString docLnkDir; |
20 | }; | 29 | }; |
21 | 30 | ||
22 | 31 | ||
23 | #endif | 32 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 7c54441..b5e86f5 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "packagelistitem.h" | 10 | #include "packagelistitem.h" |
2 | 11 | ||
3 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
4 | #include <qobject.h> | 13 | #include <qobject.h> |
5 | 14 | ||
6 | #include "debug.h" | 15 | #include "debug.h" |
7 | 16 | ||
8 | static QPixmap *pm_uninstalled=0; | 17 | static QPixmap *pm_uninstalled=0; |
9 | static QPixmap *pm_uninstalled_old=0; | 18 | static QPixmap *pm_uninstalled_old=0; |
10 | static QPixmap *pm_installed=0; | 19 | static QPixmap *pm_installed=0; |
11 | static QPixmap *pm_installed_old=0; | 20 | static QPixmap *pm_installed_old=0; |
12 | static QPixmap *pm_uninstall=0; | 21 | static QPixmap *pm_uninstall=0; |
13 | static QPixmap *pm_install=0; | 22 | static QPixmap *pm_install=0; |
14 | static QPixmap *pm_uninstalled_old_installed_new=0; | 23 | static QPixmap *pm_uninstalled_old_installed_new=0; |
15 | static QPixmap *pm_uninstalled_installed_old=0; | 24 | static QPixmap *pm_uninstalled_installed_old=0; |
16 | 25 | ||
17 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) | 26 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
18 | :QCheckListItem(lv,pi->name(),CheckBox) | 27 | :QCheckListItem(lv,pi->name(),CheckBox) |
19 | { | 28 | { |
20 | init(pi,s); | 29 | init(pi,s); |
21 | } | 30 | } |
22 | 31 | ||
23 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) | 32 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) |
24 | :QCheckListItem(lvi,pi->name(),CheckBox) | 33 | :QCheckListItem(lvi,pi->name(),CheckBox) |
25 | { | 34 | { |
26 | init(pi,s); | 35 | init(pi,s); |
27 | } | 36 | } |
28 | 37 | ||
29 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | 38 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) |
30 | { | 39 | { |
31 | package = pi; | 40 | package = pi; |
32 | settings = s; | 41 | settings = s; |
33 | setExpandable( true ); | 42 | setExpandable( true ); |
34 | QCheckListItem *item; | 43 | QCheckListItem *item; |
35 | nameItem = new QCheckListItem( this, "" ); | 44 | nameItem = new QCheckListItem( this, "" ); |
36 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); | 45 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); |
37 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | 46 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); |
38 | destItem = new QCheckListItem( this, "" ); | 47 | destItem = new QCheckListItem( this, "" ); |
39 | linkItem = new QCheckListItem( this, "" ); | 48 | linkItem = new QCheckListItem( this, "" ); |
40 | statusItem = new QCheckListItem( this, "" ); | 49 | statusItem = new QCheckListItem( this, "" ); |
41 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); | 50 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); |
42 | item = new QCheckListItem( otherItem, QObject::tr("Install Name: ")+pi->installName() ); | 51 | item = new QCheckListItem( otherItem, QObject::tr("Install Name: ")+pi->installName() ); |
43 | QDict<QString> *fields = pi->getFields(); | 52 | QDict<QString> *fields = pi->getFields(); |
44 | QDictIterator<QString> it( *fields ); | 53 | QDictIterator<QString> it( *fields ); |
45 | while ( it.current() ) { | 54 | while ( it.current() ) { |
46 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); | 55 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); |
47 | ++it; | 56 | ++it; |
48 | } | 57 | } |
49 | displayDetails(); | 58 | displayDetails(); |
50 | 59 | ||
51 | if (!pm_uninstalled) | 60 | if (!pm_uninstalled) |
52 | { | 61 | { |
53 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 62 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
54 | pm_uninstalled_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOld")); | 63 | pm_uninstalled_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOld")); |
55 | pm_uninstalled_old_installed_new = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOldinstalledNew")); | 64 | pm_uninstalled_old_installed_new = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOldinstalledNew")); |
56 | pm_uninstalled_installed_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledInstalledOld")); | 65 | pm_uninstalled_installed_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledInstalledOld")); |
57 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 66 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
58 | pm_installed_old = new QPixmap(Resource::loadPixmap("oipkg/installedOld")); | 67 | pm_installed_old = new QPixmap(Resource::loadPixmap("oipkg/installedOld")); |
59 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 68 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
60 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 69 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
61 | } | 70 | } |
62 | } | 71 | } |
63 | 72 | ||
64 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 73 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h index 65e9711..dba44f7 100644 --- a/noncore/unsupported/oipkg/packagelistitem.h +++ b/noncore/unsupported/oipkg/packagelistitem.h | |||
@@ -1,41 +1,50 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PK_LISTITEM_H | 10 | #ifndef PK_LISTITEM_H |
2 | #define PK_LISTITEM_H | 11 | #define PK_LISTITEM_H |
3 | 12 | ||
4 | #include "package.h" | 13 | #include "package.h" |
5 | 14 | ||
6 | #include <qstring.h> | 15 | #include <qstring.h> |
7 | #include <qlistview.h> | 16 | #include <qlistview.h> |
8 | #include <qpainter.h> | 17 | #include <qpainter.h> |
9 | #include <qpixmap.h> | 18 | #include <qpixmap.h> |
10 | #include <qdict.h> | 19 | #include <qdict.h> |
11 | 20 | ||
12 | #include "pksettings.h" | 21 | #include "pksettings.h" |
13 | 22 | ||
14 | class PackageListItem | 23 | class PackageListItem |
15 | : public QCheckListItem | 24 | : public QCheckListItem |
16 | { | 25 | { |
17 | public: | 26 | public: |
18 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); | 27 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); |
19 | PackageListItem(QListView*, Package*, PackageManagerSettings*); | 28 | PackageListItem(QListView*, Package*, PackageManagerSettings*); |
20 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); | 29 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); |
21 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); | 30 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); |
22 | QPixmap statePixmap() const; | 31 | QPixmap statePixmap() const; |
23 | QString key( int, bool ) const; | 32 | QString key( int, bool ) const; |
24 | Package* getPackage() { return package; } ; | 33 | Package* getPackage() { return package; } ; |
25 | QString getName() { return package->name(); } ; | 34 | QString getName() { return package->name(); } ; |
26 | bool isInstalled(){ return package->installed(); }; | 35 | bool isInstalled(){ return package->installed(); }; |
27 | virtual void setOn ( bool ); | 36 | virtual void setOn ( bool ); |
28 | void displayDetails(); | 37 | void displayDetails(); |
29 | 38 | ||
30 | private: | 39 | private: |
31 | void init(Package*, PackageManagerSettings*); | 40 | void init(Package*, PackageManagerSettings*); |
32 | QCheckListItem *nameItem; | 41 | QCheckListItem *nameItem; |
33 | QCheckListItem *destItem; | 42 | QCheckListItem *destItem; |
34 | QCheckListItem *linkItem; | 43 | QCheckListItem *linkItem; |
35 | QCheckListItem *statusItem; | 44 | QCheckListItem *statusItem; |
36 | PackageManagerSettings *settings; | 45 | PackageManagerSettings *settings; |
37 | Package *package; | 46 | Package *package; |
38 | }; | 47 | }; |
39 | 48 | ||
40 | 49 | ||
41 | #endif | 50 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistlocal.cpp b/noncore/unsupported/oipkg/packagelistlocal.cpp index 6d931c8..b8a19253 100644 --- a/noncore/unsupported/oipkg/packagelistlocal.cpp +++ b/noncore/unsupported/oipkg/packagelistlocal.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
2 | #include <qfile.h> | 11 | #include <qfile.h> |
3 | #include <qfileinfo.h> | 12 | #include <qfileinfo.h> |
4 | #include <qtextstream.h> | 13 | #include <qtextstream.h> |
5 | #include <qstringlist.h> | 14 | #include <qstringlist.h> |
6 | #include "packagelistlocal.h" | 15 | #include "packagelistlocal.h" |
7 | 16 | ||
8 | PackageListLocal::PackageListLocal() | 17 | PackageListLocal::PackageListLocal() |
9 | : PackageList() | 18 | : PackageList() |
10 | { | 19 | { |
11 | Config cfg( "oipkg", Config::User ); | 20 | Config cfg( "oipkg", Config::User ); |
12 | cfg.setGroup( "Common" ); | 21 | cfg.setGroup( "Common" ); |
13 | statusDir = cfg.readEntry( "statusDir", "" ); | 22 | statusDir = cfg.readEntry( "statusDir", "" ); |
14 | listsDir = cfg.readEntry( "listsDir", "" ); | 23 | listsDir = cfg.readEntry( "listsDir", "" ); |
15 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | 24 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) |
16 | { | 25 | { |
17 | statusDir="/usr/lib/ipkg/"; | 26 | statusDir="/usr/lib/ipkg/"; |
18 | listsDir="/usr/lib/ipkg/lists/"; | 27 | listsDir="/usr/lib/ipkg/lists/"; |
19 | cfg.writeEntry( "statusDir", statusDir ); | 28 | cfg.writeEntry( "statusDir", statusDir ); |
20 | cfg.writeEntry( "listsDir", listsDir ); | 29 | cfg.writeEntry( "listsDir", listsDir ); |
21 | } | 30 | } |
22 | } | 31 | } |
23 | 32 | ||
24 | PackageListLocal::PackageListLocal(PackageManagerSettings* s) | 33 | PackageListLocal::PackageListLocal(PackageManagerSettings* s) |
25 | : PackageList(s) | 34 | : PackageList(s) |
26 | { | 35 | { |
27 | PackageListLocal(); | 36 | PackageListLocal(); |
28 | } | 37 | } |
29 | 38 | ||
30 | PackageListLocal::~PackageListLocal() | 39 | PackageListLocal::~PackageListLocal() |
31 | { | 40 | { |
32 | } | 41 | } |
33 | 42 | ||
34 | void PackageListLocal::parseStatus() | 43 | void PackageListLocal::parseStatus() |
35 | { | 44 | { |
36 | QStringList dests = settings->getDestinationUrls(); | 45 | QStringList dests = settings->getDestinationUrls(); |
37 | QStringList destnames = settings->getDestinationNames(); | 46 | QStringList destnames = settings->getDestinationNames(); |
38 | QStringList::Iterator name = destnames.begin(); | 47 | QStringList::Iterator name = destnames.begin(); |
39 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | 48 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) |
40 | { | 49 | { |
41 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | 50 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); |
42 | readFileEntries( *dir+statusDir+"/status", *name ); | 51 | readFileEntries( *dir+statusDir+"/status", *name ); |
43 | ++name; | 52 | ++name; |
44 | }; | 53 | }; |
45 | } | 54 | } |
46 | 55 | ||
47 | void PackageListLocal::parseList() | 56 | void PackageListLocal::parseList() |
48 | { | 57 | { |
49 | QStringList srvs = settings->getActiveServers(); | 58 | QStringList srvs = settings->getActiveServers(); |
50 | 59 | ||
51 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | 60 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) |
52 | { | 61 | { |
53 | pvDebug( 2, "List: "+listsDir+"/"+*it); | 62 | pvDebug( 2, "List: "+listsDir+"/"+*it); |
54 | readFileEntries( listsDir+"/"+*it ); | 63 | readFileEntries( listsDir+"/"+*it ); |
55 | } | 64 | } |
56 | } | 65 | } |
57 | 66 | ||
58 | 67 | ||
59 | void PackageListLocal::update() | 68 | void PackageListLocal::update() |
60 | { | 69 | { |
61 | pvDebug( 2, "parseStatus"); | 70 | pvDebug( 2, "parseStatus"); |
62 | parseStatus(); | 71 | parseStatus(); |
63 | pvDebug( 2, "parseList"); | 72 | pvDebug( 2, "parseList"); |
64 | parseList(); | 73 | parseList(); |
diff --git a/noncore/unsupported/oipkg/packagelistlocal.h b/noncore/unsupported/oipkg/packagelistlocal.h index 887126b..69f871c 100644 --- a/noncore/unsupported/oipkg/packagelistlocal.h +++ b/noncore/unsupported/oipkg/packagelistlocal.h | |||
@@ -1,30 +1,39 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PACKAGELISTLOCAL_H | 10 | #ifndef PACKAGELISTLOCAL_H |
2 | #define PACKAGELISTLOCAL_H | 11 | #define PACKAGELISTLOCAL_H |
3 | 12 | ||
4 | #include "packagelist.h" | 13 | #include "packagelist.h" |
5 | 14 | ||
6 | 15 | ||
7 | #define HACK | 16 | #define HACK |
8 | #ifdef HACK | 17 | #ifdef HACK |
9 | static QString listsDir="/usr/lib/ipkg/"; | 18 | static QString listsDir="/usr/lib/ipkg/"; |
10 | static QString statusDir="/usr/lib/ipkg/"; | 19 | static QString statusDir="/usr/lib/ipkg/"; |
11 | #endif | 20 | #endif |
12 | 21 | ||
13 | class PackageListLocal : public PackageList { | 22 | class PackageListLocal : public PackageList { |
14 | public: | 23 | public: |
15 | PackageListLocal(); | 24 | PackageListLocal(); |
16 | PackageListLocal( PackageManagerSettings* ); | 25 | PackageListLocal( PackageManagerSettings* ); |
17 | virtual ~PackageListLocal(); | 26 | virtual ~PackageListLocal(); |
18 | 27 | ||
19 | public slots: | 28 | public slots: |
20 | void update(); | 29 | void update(); |
21 | private: | 30 | private: |
22 | #ifndef HACK | 31 | #ifndef HACK |
23 | QString listsDir; | 32 | QString listsDir; |
24 | QString statusDir; | 33 | QString statusDir; |
25 | #endif | 34 | #endif |
26 | void parseStatus(); | 35 | void parseStatus(); |
27 | void parseList(); | 36 | void parseList(); |
28 | }; | 37 | }; |
29 | 38 | ||
30 | #endif | 39 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index bb29e80..b4b6979 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -1,49 +1,58 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | 10 | ||
2 | #include "packagelistremote.h" | 11 | #include "packagelistremote.h" |
3 | 12 | ||
4 | #include <qstring.h> | 13 | #include <qstring.h> |
5 | #include <stdlib.h> | 14 | #include <stdlib.h> |
6 | #include <unistd.h> | 15 | #include <unistd.h> |
7 | 16 | ||
8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | 17 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) |
9 | : PackageList(s) | 18 | : PackageList(s) |
10 | { | 19 | { |
11 | PackageListRemote(); | 20 | PackageListRemote(); |
12 | } | 21 | } |
13 | 22 | ||
14 | PackageListRemote::PackageListRemote() | 23 | PackageListRemote::PackageListRemote() |
15 | : PackageList() | 24 | : PackageList() |
16 | { | 25 | { |
17 | } | 26 | } |
18 | 27 | ||
19 | PackageListRemote::~PackageListRemote() | 28 | PackageListRemote::~PackageListRemote() |
20 | { | 29 | { |
21 | } | 30 | } |
22 | 31 | ||
23 | void PackageListRemote::query(QString s) | 32 | void PackageListRemote::query(QString s) |
24 | { | 33 | { |
25 | pvDebug(4,"set query "+s); | 34 | pvDebug(4,"set query "+s); |
26 | searchString = s; | 35 | searchString = s; |
27 | } | 36 | } |
28 | 37 | ||
29 | void PackageListRemote::update() | 38 | void PackageListRemote::update() |
30 | { | 39 | { |
31 | pvDebug(2,"PackageListRemote::update"); | 40 | pvDebug(2,"PackageListRemote::update"); |
32 | if (searchString.isEmpty()) return; | 41 | if (searchString.isEmpty()) return; |
33 | int r=0; | 42 | int r=0; |
34 | QString cmd = "wget"; | 43 | QString cmd = "wget"; |
35 | QString redirect = "/tmp/oipkg.query"; | 44 | QString redirect = "/tmp/oipkg.query"; |
36 | 45 | ||
37 | // use file for output | 46 | // use file for output |
38 | cmd += " --output-document="+redirect; | 47 | cmd += " --output-document="+redirect; |
39 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | 48 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= |
40 | QString server="http://ipkgfind.handhelds.org/"; | 49 | QString server="http://ipkgfind.handhelds.org/"; |
41 | cmd += " \""+server+"/packages.phtml"; | 50 | cmd += " \""+server+"/packages.phtml"; |
42 | cmd += "?format=pda&searchtype=package§ion="; | 51 | cmd += "?format=pda&searchtype=package§ion="; |
43 | cmd += "&query="+searchString; | 52 | cmd += "&query="+searchString; |
44 | cmd += "\""; | 53 | cmd += "\""; |
45 | 54 | ||
46 | pvDebug(4,"search :"+cmd); | 55 | pvDebug(4,"search :"+cmd); |
47 | r = system(cmd.latin1()); | 56 | r = system(cmd.latin1()); |
48 | readFileEntries( redirect, "remote" ); | 57 | readFileEntries( redirect, "remote" ); |
49 | } | 58 | } |
diff --git a/noncore/unsupported/oipkg/packagelistremote.h b/noncore/unsupported/oipkg/packagelistremote.h index 87bf10d..98632ca 100644 --- a/noncore/unsupported/oipkg/packagelistremote.h +++ b/noncore/unsupported/oipkg/packagelistremote.h | |||
@@ -1,21 +1,30 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PACKAGELISTREMOTE_H | 10 | #ifndef PACKAGELISTREMOTE_H |
2 | #define PACKAGELISTREMOTE_H | 11 | #define PACKAGELISTREMOTE_H |
3 | 12 | ||
4 | #include "packagelist.h" | 13 | #include "packagelist.h" |
5 | #include "package.h" | 14 | #include "package.h" |
6 | #include "pksettings.h" | 15 | #include "pksettings.h" |
7 | #include "debug.h" | 16 | #include "debug.h" |
8 | 17 | ||
9 | class PackageListRemote : public PackageList { | 18 | class PackageListRemote : public PackageList { |
10 | public: | 19 | public: |
11 | PackageListRemote(); | 20 | PackageListRemote(); |
12 | PackageListRemote( PackageManagerSettings* s); | 21 | PackageListRemote( PackageManagerSettings* s); |
13 | virtual ~PackageListRemote(); | 22 | virtual ~PackageListRemote(); |
14 | void query(QString); | 23 | void query(QString); |
15 | public slots: | 24 | public slots: |
16 | void update(); | 25 | void update(); |
17 | private: | 26 | private: |
18 | QString searchString; | 27 | QString searchString; |
19 | }; | 28 | }; |
20 | 29 | ||
21 | #endif | 30 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 2bb74e9..0d6fa80 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "packagelistview.h" | 10 | #include "packagelistview.h" |
2 | 11 | ||
3 | #include <qpopupmenu.h> | 12 | #include <qpopupmenu.h> |
4 | #include <qaction.h> | 13 | #include <qaction.h> |
5 | 14 | ||
6 | #include "packagelistitem.h" | 15 | #include "packagelistitem.h" |
7 | #include "pksettings.h" | 16 | #include "pksettings.h" |
8 | 17 | ||
9 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) | 18 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) |
10 | : QListView(p,n) | 19 | : QListView(p,n) |
11 | { | 20 | { |
12 | settings = s; | 21 | settings = s; |
13 | popupMenu = new QPopupMenu( this ); | 22 | popupMenu = new QPopupMenu( this ); |
14 | destsMenu = new QPopupMenu( popupMenu ); | 23 | destsMenu = new QPopupMenu( popupMenu ); |
15 | popupTimer = new QTimer( this ); | 24 | popupTimer = new QTimer( this ); |
16 | setSelectionMode(QListView::NoSelection); | 25 | setSelectionMode(QListView::NoSelection); |
17 | addColumn( tr("Package") ); | 26 | addColumn( tr("Package") ); |
18 | setRootIsDecorated( true ); | 27 | setRootIsDecorated( true ); |
19 | 28 | ||
20 | connect( popupTimer, SIGNAL(timeout()), | 29 | connect( popupTimer, SIGNAL(timeout()), |
21 | this, SLOT(showPopup()) ); | 30 | this, SLOT(showPopup()) ); |
22 | connect( this, SIGNAL( pressed( QListViewItem* ) ), | 31 | connect( this, SIGNAL( pressed( QListViewItem* ) ), |
23 | this, SLOT( setCurrent( QListViewItem* ) ) ); | 32 | this, SLOT( setCurrent( QListViewItem* ) ) ); |
24 | connect( this, SIGNAL( clicked( QListViewItem* ) ), | 33 | connect( this, SIGNAL( clicked( QListViewItem* ) ), |
25 | this, SLOT( stopTimer( QListViewItem* ) ) ); | 34 | this, SLOT( stopTimer( QListViewItem* ) ) ); |
26 | 35 | ||
27 | } | 36 | } |
28 | 37 | ||
29 | //PackageListView::~PackageListView() | 38 | //PackageListView::~PackageListView() |
30 | //{ | 39 | //{ |
31 | //} | 40 | //} |
32 | 41 | ||
33 | void PackageListView::setCurrent( QListViewItem* p ) | 42 | void PackageListView::setCurrent( QListViewItem* p ) |
34 | { | 43 | { |
35 | if ( !p ) return; | 44 | if ( !p ) return; |
36 | activePackageListItem = (PackageListItem*)p; | 45 | activePackageListItem = (PackageListItem*)p; |
37 | activePackage = activePackageListItem->getPackage(); | 46 | activePackage = activePackageListItem->getPackage(); |
38 | if (!activePackage) | 47 | if (!activePackage) |
39 | { | 48 | { |
40 | // QDictIterator<QCheckListItem> it( rootItems ); | 49 | // QDictIterator<QCheckListItem> it( rootItems ); |
41 | // while ( it.current() ) | 50 | // while ( it.current() ) |
42 | // { | 51 | // { |
43 | // if ( it.current()==p ) | 52 | // if ( it.current()==p ) |
44 | // pvDebug(2,"current item"); | 53 | // pvDebug(2,"current item"); |
45 | // ++it; | 54 | // ++it; |
46 | // } | 55 | // } |
47 | 56 | ||
48 | return; | 57 | return; |
49 | } | 58 | } |
50 | popupTimer->start( 750, true ); | 59 | popupTimer->start( 750, true ); |
51 | } | 60 | } |
52 | 61 | ||
53 | 62 | ||
54 | void PackageListView::showPopup() | 63 | void PackageListView::showPopup() |
55 | { | 64 | { |
56 | popupMenu->clear(); | 65 | popupMenu->clear(); |
57 | destsMenu->clear(); | 66 | destsMenu->clear(); |
58 | 67 | ||
59 | QAction *popupAction; | 68 | QAction *popupAction; |
60 | if ( !activePackage->installed() ) | 69 | if ( !activePackage->installed() ) |
61 | { | 70 | { |
62 | popupMenu->insertItem( tr("Install to"), destsMenu ); | 71 | popupMenu->insertItem( tr("Install to"), destsMenu ); |
63 | QStringList dests = settings->getDestinationNames(); | 72 | QStringList dests = settings->getDestinationNames(); |
64 | QString ad = settings->getDestinationName(); | 73 | QString ad = settings->getDestinationName(); |
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h index 00c0320..3c09ba8 100644 --- a/noncore/unsupported/oipkg/packagelistview.h +++ b/noncore/unsupported/oipkg/packagelistview.h | |||
@@ -1,61 +1,54 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | packagelistview.h - description | ||
3 | ------------------- | ||
4 | begin : Sat Apr 27 2002 | ||
5 | copyright : (C) 2002 by tille | ||
6 | email : tille@handhelds.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | 2 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
15 | * * | 7 | * * |
16 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
17 | 10 | ||
18 | #ifndef PACKAGELISTVIEW_H | 11 | #ifndef PACKAGELISTVIEW_H |
19 | #define PACKAGELISTVIEW_H | 12 | #define PACKAGELISTVIEW_H |
20 | 13 | ||
21 | #include <qlistview.h> | 14 | #include <qlistview.h> |
22 | #include <qaction.h> | 15 | #include <qaction.h> |
23 | #include <qdict.h> | 16 | #include <qdict.h> |
24 | #include <qstring.h> | 17 | #include <qstring.h> |
25 | #include <qtimer.h> | 18 | #include <qtimer.h> |
26 | #include <qwidget.h> | 19 | #include <qwidget.h> |
27 | #include <qpopupmenu.h> | 20 | #include <qpopupmenu.h> |
28 | #include "packagelist.h" | 21 | #include "packagelist.h" |
29 | #include "debug.h" | 22 | #include "debug.h" |
30 | 23 | ||
31 | class PackageListItem; | 24 | class PackageListItem; |
32 | class Package; | 25 | class Package; |
33 | class PackageManagerSettings; | 26 | class PackageManagerSettings; |
34 | 27 | ||
35 | class PackageListView : public QListView | 28 | class PackageListView : public QListView |
36 | { | 29 | { |
37 | Q_OBJECT | 30 | Q_OBJECT |
38 | 31 | ||
39 | public: | 32 | public: |
40 | PackageListView(QWidget*, const char*, PackageManagerSettings*); | 33 | PackageListView(QWidget*, const char*, PackageManagerSettings*); |
41 | void addList( QString, PackageList* ); | 34 | void addList( QString, PackageList* ); |
42 | //~PackageListView(); | 35 | //~PackageListView(); |
43 | QTimer *popupTimer; | 36 | QTimer *popupTimer; |
44 | private: | 37 | private: |
45 | QDict<PackageList> PackageLists; | 38 | QDict<PackageList> PackageLists; |
46 | QDict<QCheckListItem> rootItems; | 39 | QDict<QCheckListItem> rootItems; |
47 | PackageManagerSettings *settings; | 40 | PackageManagerSettings *settings; |
48 | Package *activePackage; | 41 | Package *activePackage; |
49 | PackageListItem *activePackageListItem; | 42 | PackageListItem *activePackageListItem; |
50 | QPopupMenu *popupMenu; | 43 | QPopupMenu *popupMenu; |
51 | QPopupMenu *destsMenu; | 44 | QPopupMenu *destsMenu; |
52 | public slots: | 45 | public slots: |
53 | void showPopup(); | 46 | void showPopup(); |
54 | void changePackageDest( int ); | 47 | void changePackageDest( int ); |
55 | void setCurrent( QListViewItem* ); | 48 | void setCurrent( QListViewItem* ); |
56 | void stopTimer( QListViewItem* ); | 49 | void stopTimer( QListViewItem* ); |
57 | void toggleProcess(); | 50 | void toggleProcess(); |
58 | void display(); | 51 | void display(); |
59 | }; | 52 | }; |
60 | 53 | ||
61 | #endif | 54 | #endif |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 89309a2..de1f162 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "pmipkg.h" | 10 | #include "pmipkg.h" |
2 | #include "pksettings.h" | 11 | #include "pksettings.h" |
3 | #include "package.h" | 12 | #include "package.h" |
4 | #include "packagelistitem.h" | 13 | #include "packagelistitem.h" |
5 | 14 | ||
6 | #include <opie/oprocess.h> | 15 | #include <opie/oprocess.h> |
7 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
8 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
9 | #include <qpe/stringutil.h> | 18 | #include <qpe/stringutil.h> |
10 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
11 | #include <qdir.h> | 20 | #include <qdir.h> |
12 | #include <qfile.h> | 21 | #include <qfile.h> |
13 | #include <qgroupbox.h> | 22 | #include <qgroupbox.h> |
14 | #include <qmultilineedit.h> | 23 | #include <qmultilineedit.h> |
15 | #include <qstring.h> | 24 | #include <qstring.h> |
16 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
17 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
18 | #include <qtextview.h> | 27 | #include <qtextview.h> |
19 | 28 | ||
20 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
21 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
22 | #include <qlayout.h> | 31 | #include <qlayout.h> |
23 | 32 | ||
24 | #include <stdlib.h> | 33 | #include <stdlib.h> |
25 | #include <unistd.h> | 34 | #include <unistd.h> |
26 | 35 | ||
27 | #include "mainwindow.h" | 36 | #include "mainwindow.h" |
28 | 37 | ||
29 | 38 | ||
30 | //#define OPROCESS | 39 | //#define OPROCESS |
31 | 40 | ||
32 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 41 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
33 | : QObject ( p ) | 42 | : QObject ( p ) |
34 | { | 43 | { |
35 | settings = s; | 44 | settings = s; |
36 | runwindow = new RunWindow( p, name, true, f ); | 45 | runwindow = new RunWindow( p, name, true, f ); |
37 | #ifdef OPROCESS | 46 | #ifdef OPROCESS |
38 | ipkgProcess = new OProcess(); | 47 | ipkgProcess = new OProcess(); |
39 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 48 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
40 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 49 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
41 | 50 | ||
42 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), | 51 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), |
43 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 52 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
44 | installDialog = 0; | 53 | installDialog = 0; |
45 | #endif | 54 | #endif |
46 | } | 55 | } |
47 | 56 | ||
48 | PmIpkg::~PmIpkg() | 57 | PmIpkg::~PmIpkg() |
49 | { | 58 | { |
50 | #ifdef OPROCESS | 59 | #ifdef OPROCESS |
51 | delete ipkgProcess; | 60 | delete ipkgProcess; |
52 | #endif | 61 | #endif |
53 | } | 62 | } |
54 | 63 | ||
55 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | 64 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) |
56 | { | 65 | { |
57 | bool ret=false; | 66 | bool ret=false; |
58 | QDir::setCurrent("/tmp"); | 67 | QDir::setCurrent("/tmp"); |
59 | QString cmd = "/usr/bin/ipkg "; | 68 | QString cmd = "/usr/bin/ipkg "; |
60 | #ifdef OPROCESS | 69 | #ifdef OPROCESS |
61 | ipkgProcess->clearArguments(); | 70 | ipkgProcess->clearArguments(); |
62 | *ipkgProcess << "/usr/bin/ipkg "; | 71 | *ipkgProcess << "/usr/bin/ipkg "; |
63 | cmd = ""; | 72 | cmd = ""; |
64 | #endif | 73 | #endif |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 2c92348..28bc5dd 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PMIPKG_H | 10 | #ifndef PMIPKG_H |
2 | #define PMIPKG_H | 11 | #define PMIPKG_H |
3 | 12 | ||
4 | 13 | ||
5 | #include <opie/oprocess.h> | 14 | #include <opie/oprocess.h> |
6 | #include <qobject.h> | 15 | #include <qobject.h> |
7 | #include <qlist.h> | 16 | #include <qlist.h> |
8 | #include <qstring.h> | 17 | #include <qstring.h> |
9 | #include <qwidget.h> | 18 | #include <qwidget.h> |
10 | #include "pksettings.h" | 19 | #include "pksettings.h" |
11 | #include "runwindow.h" | 20 | #include "runwindow.h" |
12 | #include "packagelist.h" | 21 | #include "packagelist.h" |
13 | #include "installdialog.h" | 22 | #include "installdialog.h" |
14 | #include "debug.h" | 23 | #include "debug.h" |
15 | 24 | ||
16 | #define createLink 0 | 25 | #define createLink 0 |
17 | #define removeLink 1 | 26 | #define removeLink 1 |
18 | 27 | ||
19 | class Package; | 28 | class Package; |
20 | class PmIpkg : public QObject | 29 | class PmIpkg : public QObject |
21 | { | 30 | { |
22 | Q_OBJECT | 31 | Q_OBJECT |
23 | public: | 32 | public: |
24 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 33 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
25 | ~PmIpkg(); | 34 | ~PmIpkg(); |
26 | 35 | ||
27 | int linkOpp; | 36 | int linkOpp; |
28 | void loadList( PackageList* ); | 37 | void loadList( PackageList* ); |
29 | void commit(); | 38 | void commit(); |
30 | void update(); | 39 | void update(); |
31 | void show(); | 40 | void show(); |
32 | /** No descriptions */ | 41 | /** No descriptions */ |
33 | void clearLists(); | 42 | void clearLists(); |
34 | 43 | ||
35 | public slots: | 44 | public slots: |
36 | void doIt(); | 45 | void doIt(); |
37 | void install(); | 46 | void install(); |
38 | void remove(); | 47 | void remove(); |
39 | void installFile(const QString &fileName, const QString &dest=""); | 48 | void installFile(const QString &fileName, const QString &dest=""); |
40 | void removeFile(const QString &fileName, const QString &dest=""); | 49 | void removeFile(const QString &fileName, const QString &dest=""); |
41 | void createLinks( const QString &dest ); | 50 | void createLinks( const QString &dest ); |
42 | void removeLinks( const QString &dest ); | 51 | void removeLinks( const QString &dest ); |
43 | 52 | ||
44 | //private slots: | 53 | //private slots: |
45 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); | 54 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); |
46 | 55 | ||
47 | private: | 56 | private: |
48 | OProcess *ipkgProcess; | 57 | OProcess *ipkgProcess; |
49 | PackageManagerSettings* settings; | 58 | PackageManagerSettings* settings; |
50 | RunWindow *runwindow; | 59 | RunWindow *runwindow; |
51 | InstallDialog *installDialog; | 60 | InstallDialog *installDialog; |
52 | QList<Package> to_remove; | 61 | QList<Package> to_remove; |
53 | QList<Package> to_install; | 62 | QList<Package> to_install; |
54 | void makeLinks(Package*); | 63 | void makeLinks(Package*); |
55 | void linkPackage( QString, QString ); | 64 | void linkPackage( QString, QString ); |
56 | void processLinkDir( QString , QString ); | 65 | void processLinkDir( QString , QString ); |
57 | bool runIpkg(const QString& args, const QString& dest="" ); | 66 | bool runIpkg(const QString& args, const QString& dest="" ); |
58 | void out( QString ); | 67 | void out( QString ); |
59 | QStringList* getList( QString, QString ); | 68 | QStringList* getList( QString, QString ); |
60 | void processFileList( QStringList*, QString ); | 69 | void processFileList( QStringList*, QString ); |
61 | 70 | ||
62 | 71 | ||
63 | }; | 72 | }; |
64 | 73 | ||
diff --git a/noncore/unsupported/oipkg/settings.cpp b/noncore/unsupported/oipkg/settings.cpp index 85daa98..4bd60c0 100644 --- a/noncore/unsupported/oipkg/settings.cpp +++ b/noncore/unsupported/oipkg/settings.cpp | |||
@@ -1,64 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #include "pksettings.h" | 10 | #include "pksettings.h" |
2 | 11 | ||
3 | #include <qpe/config.h> | 12 | #include <qpe/config.h> |
4 | #include <qcombobox.h> | 13 | #include <qcombobox.h> |
5 | #include <qfile.h> | 14 | #include <qfile.h> |
6 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
7 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
8 | #include <qlistbox.h> | 17 | #include <qlistbox.h> |
9 | #include <qcheckbox.h> | 18 | #include <qcheckbox.h> |
10 | #include <qstring.h> | 19 | #include <qstring.h> |
11 | #include <qobject.h> | 20 | #include <qobject.h> |
12 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
13 | #include <qtabwidget.h> | 22 | #include <qtabwidget.h> |
14 | 23 | ||
15 | 24 | ||
16 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) | 25 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) |
17 | : PackageManagerSettingsBase( parent, name, fl ) | 26 | : PackageManagerSettingsBase( parent, name, fl ) |
18 | { | 27 | { |
19 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); | 28 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); |
20 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); | 29 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); |
21 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 30 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
22 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); | 31 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); |
23 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); | 32 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); |
24 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 33 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
25 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 34 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), |
26 | // activeLinkDestination, SLOT(setEnabled(bool)) ); | 35 | // activeLinkDestination, SLOT(setEnabled(bool)) ); |
27 | 36 | ||
28 | connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); | 37 | connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); |
29 | connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); | 38 | connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); |
30 | connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); | 39 | connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); |
31 | connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); | 40 | connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); |
32 | connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); | 41 | connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); |
33 | servername->setEnabled(FALSE); | 42 | servername->setEnabled(FALSE); |
34 | serverurl->setEnabled(FALSE); | 43 | serverurl->setEnabled(FALSE); |
35 | serverurlDic.setAutoDelete(TRUE); | 44 | serverurlDic.setAutoDelete(TRUE); |
36 | destinationname->setEnabled(FALSE); | 45 | destinationname->setEnabled(FALSE); |
37 | destinationurl->setEnabled(FALSE); | 46 | destinationurl->setEnabled(FALSE); |
38 | destinationurlDic.setAutoDelete(TRUE); | 47 | destinationurlDic.setAutoDelete(TRUE); |
39 | readSettings(); | 48 | readSettings(); |
40 | } | 49 | } |
41 | 50 | ||
42 | PackageManagerSettings::~PackageManagerSettings() | 51 | PackageManagerSettings::~PackageManagerSettings() |
43 | { | 52 | { |
44 | } | 53 | } |
45 | 54 | ||
46 | 55 | ||
47 | void PackageManagerSettings::newServer() | 56 | void PackageManagerSettings::newServer() |
48 | { | 57 | { |
49 | int i = servers->count(); | 58 | int i = servers->count(); |
50 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 59 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
51 | serverurlDic.insert(i,new QString("http://")); | 60 | serverurlDic.insert(i,new QString("http://")); |
52 | servers->insertItem(tr("New")); | 61 | servers->insertItem(tr("New")); |
53 | activeServers->insertItem(tr("New")); | 62 | activeServers->insertItem(tr("New")); |
54 | } else { | 63 | } else { |
55 | // allows one-level undo | 64 | // allows one-level undo |
56 | serverurlDic.insert(i,new QString(serverurl->text())); | 65 | serverurlDic.insert(i,new QString(serverurl->text())); |
57 | servers->insertItem(servername->text()); | 66 | servers->insertItem(servername->text()); |
58 | activeServers->insertItem(servername->text()); | 67 | activeServers->insertItem(servername->text()); |
59 | } | 68 | } |
60 | servers->setSelected(i,TRUE); | 69 | servers->setSelected(i,TRUE); |
61 | editServer(i); | 70 | editServer(i); |
62 | } | 71 | } |
63 | 72 | ||
64 | void PackageManagerSettings::newDestination() | 73 | void PackageManagerSettings::newDestination() |
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index 9cb7a9b..44459b2 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h | |||
@@ -1,67 +1,75 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * (at your option) any later version. * | ||
7 | * * | ||
8 | ***************************************************************************/ | ||
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
1 | #ifndef PACKAGEMANAGERSETTINGS_H | 10 | #ifndef PACKAGEMANAGERSETTINGS_H |
2 | #define PACKAGEMANAGERSETTINGS_H | 11 | #define PACKAGEMANAGERSETTINGS_H |
3 | 12 | ||
4 | #include "pksettingsbase.h" | 13 | #include "pksettingsbase.h" |
5 | #include <qintdict.h> | 14 | #include <qintdict.h> |
6 | 15 | ||
7 | 16 | ||
8 | class PackageManagerSettings : public PackageManagerSettingsBase | 17 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | //class PackageManagerSettings : private PackageManagerSettingsBase | ||
10 | { | 18 | { |
11 | Q_OBJECT | 19 | Q_OBJECT |
12 | public: | 20 | public: |
13 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 21 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
14 | ~PackageManagerSettings(); | 22 | ~PackageManagerSettings(); |
15 | 23 | ||
16 | bool showDialog( int ) ; | 24 | bool showDialog( int ) ; |
17 | QString getDestinationUrl(); | 25 | QString getDestinationUrl(); |
18 | QString getDestinationName(); | 26 | QString getDestinationName(); |
19 | QString getLinkDestinationName(); | 27 | QString getLinkDestinationName(); |
20 | bool createLinks(); | 28 | bool createLinks(); |
21 | QStringList getActiveServers(); | 29 | QStringList getActiveServers(); |
22 | QStringList getDestinationUrls(); | 30 | QStringList getDestinationUrls(); |
23 | 31 | ||
24 | public slots: /** No descriptions */ | 32 | public slots: /** No descriptions */ |
25 | void createLinks(); | 33 | void createLinks(); |
26 | void removeLinks(); | 34 | void removeLinks(); |
27 | void writeInstallationSettings(); | 35 | void writeInstallationSettings(); |
28 | void readInstallationSettings(); | 36 | void readInstallationSettings(); |
29 | void writeCurrentInstallationSetting(); | 37 | void writeCurrentInstallationSetting(); |
30 | void readInstallationSetting(int); | 38 | void readInstallationSetting(int); |
31 | void installationSettingSetName(const QString &); | 39 | void installationSettingSetName(const QString &); |
32 | void activeDestinationChange(int) | 40 | void activeDestinationChange(int) |
33 | void newServer(); | 41 | void newServer(); |
34 | void editServer(int); | 42 | void editServer(int); |
35 | void removeDestination(); | 43 | void removeDestination(); |
36 | void newDestination(); | 44 | void newDestination(); |
37 | void editDestination(int); | 45 | void editDestination(int); |
38 | void linkEnabled(bool); | 46 | void linkEnabled(bool); |
39 | void removeServer(); | 47 | void removeServer(); |
40 | void serverNameChanged(const QString&); | 48 | void serverNameChanged(const QString&); |
41 | void serverUrlChanged(const QString&); | 49 | void serverUrlChanged(const QString&); |
42 | void destNameChanged(const QString&); | 50 | void destNameChanged(const QString&); |
43 | void destUrlChanged(const QString&); | 51 | void destUrlChanged(const QString&); |
44 | void installationSettingChange(int); | 52 | void installationSettingChange(int); |
45 | void newInstallationSetting(); | 53 | void newInstallationSetting(); |
46 | void removeInstallationSetting(); | 54 | void removeInstallationSetting(); |
47 | void renameInstallationSetting(); | 55 | void renameInstallationSetting(); |
48 | 56 | ||
49 | private: | 57 | private: |
50 | QIntDict<QString> serverurlDic; | 58 | QIntDict<QString> serverurlDic; |
51 | QIntDict<QString> destinationurlDic; | 59 | QIntDict<QString> destinationurlDic; |
52 | int ipkg_old; | 60 | int ipkg_old; |
53 | int editedserver; | 61 | int editedserver; |
54 | int editeddestination; | 62 | int editeddestination; |
55 | int currentSetting; | 63 | int currentSetting; |
56 | int installationSettingsCount; | 64 | int installationSettingsCount; |
57 | bool changed; | 65 | bool changed; |
58 | bool serverChanged; | 66 | bool serverChanged; |
59 | 67 | ||
60 | bool readIpkgConfig(const QString&); | 68 | bool readIpkgConfig(const QString&); |
61 | void writeIpkgConfig(const QString&); | 69 | void writeIpkgConfig(const QString&); |
62 | void writeSettings(); | 70 | void writeSettings(); |
63 | void readSettings(); | 71 | void readSettings(); |
64 | }; | 72 | }; |
65 | 73 | ||
66 | #endif | 74 | #endif |
67 | 75 | ||