23 files changed, 526 insertions, 524 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp index 3b794b4..5d61342 100644 --- a/noncore/settings/packagemanager/entrydlg.cpp +++ b/noncore/settings/packagemanager/entrydlg.cpp @@ -1,107 +1,108 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2004 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "entrydlg.h" #include <opie2/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qpushbutton.h> EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) : QDialog( parent, name, modal ) { QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 ); QLabel *l = new QLabel( label, this ); l->setAlignment( AlignLeft | AlignTop | WordBreak ); layout->addMultiCellWidget( l, 0, 0, 0, 1 ); m_entry = new QLineEdit( this ); layout->addWidget( m_entry, 1, 0 ); connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) ); QPixmap pic; pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); QPushButton *btn = new QPushButton( pic, QString::null, this ); btn->setMaximumWidth( btn->height() ); connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); layout->addWidget( btn, 1, 1 ); layout->setRowStretch( 2, 10 ); resize( width(), l->height() + btn->height() + 8 ); } void EntryDlg::setText( const QString &text ) { m_entry->setText( text ); m_entry->selectAll(); } QString EntryDlg::getText() { return m_entry->text(); } QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, QWidget *parent, const char *name ) { EntryDlg *dlg = new EntryDlg( label, parent, name, true ); dlg->setCaption( caption ); dlg->setText( text ); QString result; *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted ); if ( *ok ) result = dlg->getText(); delete dlg; return result; } void EntryDlg::slotTryAccept() { if ( !m_entry->text().isEmpty() ) accept(); } void EntryDlg::slotSelectPath() { QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_entry->text() ); if ( path.at( path.length() - 1 ) == '/' ) path.truncate( path.length() - 1 ); if ( !path.isNull() ) m_entry->setText( path ); } diff --git a/noncore/settings/packagemanager/entrydlg.h b/noncore/settings/packagemanager/entrydlg.h index 012589b..3f897ae 100644 --- a/noncore/settings/packagemanager/entrydlg.h +++ b/noncore/settings/packagemanager/entrydlg.h @@ -1,58 +1,59 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2004 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef ENTRYDLG_H #define ENTRYDLG_H #include <qdialog.h> class QLineEdit; class EntryDlg : public QDialog { Q_OBJECT public: static QString getText( const QString &caption, const QString &label, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0 ); EntryDlg( const QString &label, QWidget* parent = 0, const char* name = 0, bool modal = true ); void setText( const QString &text ); QString getText(); private slots: void slotTryAccept(); void slotSelectPath(); private: QLineEdit *m_entry; }; #endif // EntryDlg_H diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp index e69b6eb..4924972 100644 --- a/noncore/settings/packagemanager/filterdlg.cpp +++ b/noncore/settings/packagemanager/filterdlg.cpp @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "filterdlg.h" #include <qwhatsthis.h> FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, const QString &server, const QString &destination, OPackageManager::Status status, const QString &category ) : QDialog( parent, QString::null, true, WStyle_ContextHelp ) { setCaption( tr( "Filter packages" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); QScrollView *sv = new QScrollView( this ); layout->addWidget( sv, 0, 0 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); layout = new QVBoxLayout( container, 4, 4 ); // Category m_categoryCB = new QCheckBox( tr( "Category:" ), container ); QWhatsThis::add( m_categoryCB, tr( "Tap here to filter package list by application category." ) ); connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); m_category = new QComboBox( container ); QWhatsThis::add( m_category, tr( "Select the application category to filter by here." ) ); m_category->insertStringList( pm->categories() ); initItem( m_category, m_categoryCB, category ); layout->addWidget( m_categoryCB ); layout->addWidget( m_category ); // Package name m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); QWhatsThis::add( m_nameCB, tr( "Tap here to filter package list by package name." ) ); connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); m_name = new QLineEdit( name, container ); QWhatsThis::add( m_name, tr( "Enter the package name to filter by here." ) ); if ( !name.isNull() ) m_nameCB->setChecked( true ); m_name->setEnabled( !name.isNull() ); layout->addWidget( m_nameCB ); layout->addWidget( m_name ); // Status m_statusCB = new QCheckBox( tr( "With the status:" ), container ); QWhatsThis::add( m_statusCB, tr( "Tap here to filter package list by the package status." ) ); connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); m_status = new QComboBox( container ); QWhatsThis::add( m_status, tr( "Select the package status to filter by here." ) ); connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) ); QString currStatus; switch ( status ) { case OPackageManager::All : currStatus = tr( "All" ); break; case OPackageManager::Installed : currStatus = tr( "Installed" ); break; case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); break; case OPackageManager::Updated : currStatus = tr( "Updated" ); break; default : currStatus = QString::null; }; m_status->insertItem( tr( "All" ) ); m_status->insertItem( tr( "Installed" ) ); m_status->insertItem( tr( "Not installed" ) ); m_status->insertItem( tr( "Updated" ) ); initItem( m_status, m_statusCB, currStatus ); layout->addWidget( m_statusCB ); layout->addWidget( m_status ); // Server m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) ); connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); m_server = new QComboBox( container ); QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) ); m_server->insertStringList( pm->servers() ); initItem( m_server, m_serverCB, server ); layout->addWidget( m_serverCB ); layout->addWidget( m_server ); // Destination m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) ); connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); m_destination = new QComboBox( container ); QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) ); m_destination->insertStringList( pm->destinations() ); initItem( m_destination, m_destCB, destination ); layout->addWidget( m_destCB ); layout->addWidget( m_destination ); } diff --git a/noncore/settings/packagemanager/filterdlg.h b/noncore/settings/packagemanager/filterdlg.h index bd89b42..6f39464 100644 --- a/noncore/settings/packagemanager/filterdlg.h +++ b/noncore/settings/packagemanager/filterdlg.h @@ -1,101 +1,102 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> - .=l. - .>+-= - _;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: - : = ...= . :.=- You should have received a copy of the GNU - -. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. + .=l. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef FILTERDLG_H #define FILTERDLG_H #include "opackagemanager.h" #include <qcheckbox.h> #include <qdialog.h> #include <qcombobox.h> #include <qlayout.h> #include <qlineedit.h> #include <qscrollview.h> class FilterDlg : public QDialog { Q_OBJECT public: FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0, const QString &server = 0x0, const QString &destination = 0x0, OPackageManager::Status status = OPackageManager::All, const QString &category = 0x0 ); QString name() { return m_nameCB->isChecked() ? m_name->text() : QString::null; }; QString server() { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; }; QString destination() { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; }; OPackageManager::Status status() { if ( m_statusCB->isChecked() ) { if ( m_status->currentText() == tr( "All" ) ) return OPackageManager::All; else if ( m_status->currentText() == tr( "Installed" ) ) return OPackageManager::Installed; else if ( m_status->currentText() == tr( "Not installed" ) ) return OPackageManager::NotInstalled; else if ( m_status->currentText() == tr( "Updated" ) ) return OPackageManager::Updated; } return OPackageManager::NotDefined; }; QString category() { return m_categoryCB->isChecked() ? m_category->currentText() : QString::null; }; private: QCheckBox *m_nameCB; QCheckBox *m_serverCB; QCheckBox *m_destCB; QCheckBox *m_statusCB; QCheckBox *m_categoryCB; QLineEdit *m_name; QComboBox *m_server; QComboBox *m_destination; QComboBox *m_status; QComboBox *m_category; void initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ); private slots: void slotNameSelected( bool ); void slotServerSelected( bool ); void slotDestSelected( bool ); void slotStatusSelected( bool ); void slotStatusChanged( const QString & ); void slotCategorySelected( bool ); }; #endif diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 8aed10d..205d7ed 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "installdlg.h" #include <opie2/ofiledialog.h> #include <qpe/fileselector.h> #include <qpe/resource.h> #include <qpe/storage.h> #include <qapplication.h> #include <qcombobox.h> #include <qfileinfo.h> #include <qgroupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qmap.h> #include <qmultilineedit.h> #include <qpushbutton.h> #include <sys/vfs.h> #include "opackagemanager.h" InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, OPackage::Command command1, const QStringList &packages1, OPackage::Command command2, const QStringList &packages2, OPackage::Command command3, const QStringList &packages3 ) : QWidget( 0l ) , m_packman( pm ) , m_installFound( false ) , m_numCommands( 0 ) , m_currCommand( 0 ) , m_destItem( 0l ) { // Save command/package list information if ( command1 != OPackage::NotDefined ) { m_command[ m_numCommands ] = command1; m_packages[ m_numCommands ] = packages1; ++m_numCommands; if ( command1 == OPackage::Install ) m_installFound = true; } if ( command2 != OPackage::NotDefined ) { m_command[ m_numCommands ] = command2; m_packages[ m_numCommands ] = packages2; ++m_numCommands; if ( command2 == OPackage::Install ) m_installFound = true; } if ( command3 != OPackage::NotDefined ) { m_command[ m_numCommands ] = command3; m_packages[ m_numCommands ] = packages3; ++m_numCommands; if ( command3 == OPackage::Install ) m_installFound = true; } // Initialize UI if ( parent ) parent->setCaption( caption ); QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); if ( m_installFound ) { QLabel *label = new QLabel( tr( "Destination" ), this ); layout->addWidget( label, 0, 0 ); m_destination = new QComboBox( this ); m_destination->insertStringList( m_packman->destinations() ); layout->addWidget( m_destination, 0, 1 ); connect( m_destination, SIGNAL(highlighted(const QString&)), this, SLOT(slotDisplayAvailSpace(const QString&)) ); label = new QLabel( tr( "Space Avail" ), this ); layout->addWidget( label, 1, 0 ); m_availSpace = new QLabel( this ); layout->addWidget( m_availSpace, 1, 1 ); // TODO - select correct destination slotDisplayAvailSpace( m_destination->currentText() ); } else { m_destination = 0l; m_availSpace = 0l; } QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); groupBox->layout()->setSpacing( 0 ); diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h index e633809..a41a38f 100644 --- a/noncore/settings/packagemanager/installdlg.h +++ b/noncore/settings/packagemanager/installdlg.h @@ -1,92 +1,93 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef INSTALLDLG_H #define INSTALLDLG_H #include <qwidget.h> #include "opackage.h" class QComboBox; class QLabel; class QMultiLineEdit; class QPushButton; class OConfItem; class OPackageManager; class InstallDlg : public QWidget { Q_OBJECT public: InstallDlg( QWidget *parent = 0l, OPackageManager *pm = 0l, const QString &caption = QString::null, OPackage::Command command1 = OPackage::NotDefined, const QStringList &packages1 = QStringList(), OPackage::Command command2 = OPackage::NotDefined, const QStringList &packages2 = QStringList(), OPackage::Command command3 = OPackage::NotDefined, const QStringList &packages3 = QStringList() ); private: OPackageManager *m_packman; // Pointer to application instance of package manager bool m_installFound; // Indicates if an install is being done, controls display of // destination selection, available space // UI controls QComboBox *m_destination; // Destination selection list QLabel *m_availSpace; // Text label to display available space on selected destination QMultiLineEdit *m_output; // Multi-line edit to display status QPushButton *m_btnStart; // Start/abort/close button QPushButton *m_btnOptions; // Installation options button // Commands and packages to execute int m_numCommands; // Number of commands to be executed int m_currCommand; // Number of currently executing command OPackage::Command m_command[3]; // List of commands to be executed QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) OConfItem *m_destItem; // Pointer to destination for package installation private slots: // UI control slots void slotDisplayAvailSpace( const QString &destination ); void slotBtnStart(); void slotBtnOptions(); // Execution slots void slotOutput( const QString &msg ); signals: void closeInstallDlg(); }; #endif diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp index 3792881..5863662 100644 --- a/noncore/settings/packagemanager/main.cpp +++ b/noncore/settings/packagemanager/main.cpp @@ -1,34 +1,35 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> - .=l. - .>+-= - _;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: - : = ...= . :.=- You should have received a copy of the GNU - -. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. + .=l. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "mainwindow.h" #include <opie2/oapplicationfactory.h> OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 8a5b90c..0e40c01 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "mainwindow.h" #include "installdlg.h" #include "filterdlg.h" #include "promptdlg.h" #include "entrydlg.h" #include "packageinfodlg.h" #include <opie2/ofiledialog.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qaction.h> #include <qdir.h> #include <qlayout.h> #include <qlineedit.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qtimer.h> #include <qtoolbar.h> #include <qwhatsthis.h> MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) : QMainWindow( parent, name, WStyle_ContextHelp ) , m_config( "packman" ) , m_packman( &m_config, this ) , m_menuBar( this ) , m_toolBar( this ) , m_findBar( this ) , m_widgetStack( this ) , m_packageList( this ) , m_statusWidget( this ) , m_statusText( &m_statusWidget ) , m_statusBar( &m_statusWidget ) , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) , m_iconInstalled( Resource::loadPixmap( "installed" ) ) , m_iconNull( m_iconUpdated.size() ) , m_filterName( QString::null ) , m_filterServer( QString::null ) , m_filterDest( QString::null ) , m_filterStatus( OPackageManager::NotDefined ) , m_filterCategory( QString::null ) { // setCaption( tr( "Package Manager" ) ); m_iconNull.fill( colorGroup().base() ); connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); // Initialize widget stack, package list and status widget initStatusWidget(); initPackageList(); m_widgetStack.addWidget( &m_statusWidget, 2 ); m_widgetStack.addWidget( &m_packageList, 1 ); setCentralWidget( &m_widgetStack ); // Initialize remaining user interface items initUI(); // Initialize package information QTimer::singleShot( -1, this, SLOT( initPackageInfo() ) ); } void MainWindow::closeEvent( QCloseEvent *event ) { // Close app only if either the package or status widgets are currently active bool close = m_widgetStack.visibleWidget() == &m_packageList || m_widgetStack.visibleWidget() == &m_statusWidget; if ( close ) { // TODO - write out application configuration settings // Write out package manager configuration settings m_packman.saveSettings(); event->accept(); } else { delete m_widgetStack.visibleWidget(); m_widgetStack.raiseWidget( &m_packageList ); event->ignore(); } } void MainWindow::initPackageList() { m_packageList.addColumn( tr( "Packages" ) ); QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nTap inside the box at the left to select a package. Tap and hold to view package details." ) ); QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h index f00e344..e7003e4 100644 --- a/noncore/settings/packagemanager/mainwindow.h +++ b/noncore/settings/packagemanager/mainwindow.h @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include "opackagemanager.h" #include <qpe/config.h> #include <qlabel.h> #include <qlistview.h> #include <qmainwindow.h> #include <qpixmap.h> #include <qprogressbar.h> #include <qtoolbar.h> #include <qwidgetstack.h> class QAction; class QLineEdit; class MainWindow :public QMainWindow { Q_OBJECT public: MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }; protected: void closeEvent( QCloseEvent *event ); private: Config m_config; // Configuration file OPackageManager m_packman; // Package manager // Toolbars QToolBar m_menuBar; // Main toolbar containing menu QToolBar m_toolBar; // Main toolbar QToolBar m_findBar; // Find toolbar QWidgetStack m_widgetStack; // Main widget stack which contains m_packageList & m_statusWidget QListView m_packageList; // Main list view of all packages QLineEdit *m_findEdit; // Line edit box used for find toolbar // Status widget controls QWidget m_statusWidget; // Widget to display status during long operations QLabel m_statusText; // Text status message QProgressBar m_statusBar; // Progress bar showing % completed // Icon pixmaps QPixmap m_iconUpdated; // Cached icon which shows when package can be updated QPixmap m_iconInstalled; // Cached icon which shows when package is installed QPixmap m_iconNull; // Cached icon which shows when package is not installed // Menu/tool bar actions QAction *m_actionShowNotInstalled; // Action to show pakages not currently installed QAction *m_actionShowInstalled; // Action to show pakages currently installed QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available QAction *m_actionFilter; // Action to filter packages QAction *m_actionFindNext; // Action to find next match // Cached filter settings QString m_filterName; // Cached name filter value QString m_filterServer; // Cached server name filter value QString m_filterDest; // Cached destination name filter value OPackageManager::Status m_filterStatus; // Cached status filter value QString m_filterCategory; // Cached category filter value void initPackageList(); void initStatusWidget(); void initUI(); void loadPackageList( OPackageList *packages = 0x0, bool clearList = true ); void searchForPackage( const QString &text ); void installLocalPackage( const QString &ipkFile ); private slots: void setDocument( const QString &ipkFile ); void initPackageInfo(); void slotWidgetStackShow( QWidget *widget ); // Status widget slots void slotInitStatusBar( int numSteps ); void slotStatusText( const QString &status ); void slotStatusBar( int currStep ); // Actions menu action slots void slotUpdate(); void slotUpgrade(); void slotDownload(); void slotApply(); void slotInstallLocal(); void slotCloseDlg(); diff --git a/noncore/settings/packagemanager/oconfitem.cpp b/noncore/settings/packagemanager/oconfitem.cpp index ffa936e..76c8c65 100644 --- a/noncore/settings/packagemanager/oconfitem.cpp +++ b/noncore/settings/packagemanager/oconfitem.cpp @@ -1,42 +1,41 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "oconfitem.h" OConfItem::OConfItem( Type type, const QString &name, const QString &value, const QString &features, bool active ) : m_type( type ) , m_name( name ) , m_value( value ) , m_features( features ) , m_active( active ) { } diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index b306e93..c95039e 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h @@ -1,96 +1,95 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OCONFITEM_H #define OCONFITEM_H #include <qlist.h> #include <qstring.h> class OConfItem { public: enum Type { Source, Destination, Option, Arch, Other, NotDefined }; OConfItem( Type type = NotDefined, const QString &name = QString::null, const QString &value = QString::null, const QString &features = QString::null, bool active = true ); Type type() { return m_type; } const QString &name() { return m_name; } const QString &value() { return m_value; } const QString &features() { return m_features; } bool active() { return m_active; } void setType( Type type ) { m_type = type; } void setName( const QString &name ) { m_name = name; } void setValue( const QString &value ) { m_value = value; } void setFeatures( const QString &features ) { m_features = features; } void setActive( bool active ) { m_active = active; } private: Type m_type; // Type of configuration item QString m_name; // Name of item QString m_value; // Value of item QString m_features; // Comma-deliminated list of features this item supports bool m_active; // Indicates whether item is currently active }; class OConfItemList : public QList<OConfItem> { private: int compareItems( QCollection::Item item1, QCollection::Item item2 ) { // Sort by OConfItem location then by type OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); if ( type1 < type2 ) return -1; else if ( type1 == type2 ) { QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); if ( name1 < name2 ) return -1; else if ( name1 == name2 ) return 0; else /*if ( name1 > name2 )*/ return 1; } else /*if ( type1 > type2 )*/ return 1; } }; typedef QListIterator<OConfItem> OConfItemListIterator; #endif diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index 7bc2040..ffb3687 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp @@ -1,125 +1,124 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "oipkg.h" #include <qdir.h> #include <qfile.h> #include <qtextstream.h> #include <stdlib.h> #include <unistd.h> extern "C" { #include <libipkg.h> }; args_t m_ipkgArgs; // libipkg configuration arguments const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location OIpkg *oipkg; // Ipkg callback functions int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) { // Display message only if it is below the message level threshold if ( conf && ( conf->verbosity < level ) ) return 0; else oipkg->ipkgMessage( msg ); return 0; } char *fIpkgResponse( char */*question*/ ) { return 0l; } int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ ) { oipkg->ipkgStatus( desc ); return 0; } int fIpkgFiles( char */*name*/, char *desc, char */*version*/, pkg_state_status_t /*status*/, void */*userdata*/ ) { oipkg->ipkgList( desc ); return 0; } OIpkg::OIpkg( Config *config, QObject *parent, const char *name ) : QObject( parent, name ) , m_config( config ) , m_confInfo( NULL ) , m_ipkgExecOptions( 0 ) , m_ipkgExecVerbosity( 1 ) { // Keep pointer to self for the Ipkg callback functions oipkg = this; // Initialize libipkg ipkg_init( &fsignalIpkgMessage, &fIpkgResponse, &m_ipkgArgs ); // Default ipkg run-time arguments m_ipkgArgs.noaction = false; m_ipkgArgs.force_defaults = true; } OIpkg::~OIpkg() { // Upon destruction, ensure that items in config list are deleted with list if ( m_confInfo ) m_confInfo->setAutoDelete( true ); // Free up libipkg resources ipkg_deinit( &m_ipkgArgs ); } OConfItemList *OIpkg::configItems() { // Retrieve all configuration items return filterConfItems(); } OConfItemList *OIpkg::servers() { // Retrieve only servers return filterConfItems( OConfItem::Source ); } OConfItemList *OIpkg::destinations() diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index 4e390fa..9a7802c 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h @@ -1,111 +1,110 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OIPKG_H #define OIPKG_H #include "oconfitem.h" #include "opackage.h" #include <qpe/config.h> #include <qobject.h> // Ipkg execution options (m_ipkgExecOptions) #define FORCE_DEPENDS 0x0001 #define FORCE_REMOVE 0x0002 #define FORCE_REINSTALL 0x0004 #define FORCE_OVERWRITE 0x0008 class OConfItemList; class OIpkg : public QObject { Q_OBJECT public: OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); ~OIpkg(); OConfItemList *configItems(); OConfItemList *servers(); OConfItemList *destinations(); OConfItemList *options(); int ipkgExecOptions() { return m_ipkgExecOptions; } int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } void setConfigItems( OConfItemList *configList ); void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } void saveSettings(); OPackageList *availablePackages( const QString &server = QString::null ); OPackageList *installedPackages( const QString &destName = QString::null, const QString &destPath = QString::null ); OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = QString::null ); bool executeCommand( OPackage::Command command = OPackage::NotDefined, const QStringList ¶meters = QStringList(), const QString &destination = QString::null, const QObject *receiver = 0l, const char *slotOutput = 0l, bool rawOutput = true ); void abortCommand(); void ipkgMessage( char *msg ); void ipkgStatus( char *status ); void ipkgList( char *filelist ); private: Config *m_config; // Pointer to application configuration file OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options int m_ipkgExecVerbosity; // Ipkg execution verbosity level QString m_rootPath; // Directory path where the 'root' destination is located void loadConfiguration(); OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); const QString &rootPath(); void linkPackageDir( const QString &dest = QString::null ); void unlinkPackage( const QString &package = QString::null, OConfItemList *destList = 0l ); signals: void signalIpkgMessage( const QString &msg ); void signalIpkgStatus( const QString &status ); void signalIpkgList( const QString &filelist ); }; #endif diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 0ad1c82..945571f 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -1,125 +1,124 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "oipkgconfigdlg.h" #include <opie2/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qgroupbox.h> #include <qlabel.h> #include <qlineedit.h> #include <qlistbox.h> #include <qpushbutton.h> #include <qscrollview.h> #include <qwhatsthis.h> OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) : QDialog( parent, QString::null, true, WStyle_ContextHelp ) , m_ipkg( ipkg ) , m_configs( 0l ) , m_installOptions( installOptions ) , m_serverCurrent( -1 ) , m_destCurrent( -1 ) , m_layout( this, 2, 4 ) , m_tabWidget( this ) { setCaption( tr( "Configuration" ) ); // Initialize configuration widgets if ( !installOptions ) { initServerWidget(); initDestinationWidget(); initProxyWidget(); } initOptionsWidget(); // Load configuration information initData(); // Setup tabs for all info m_layout.addWidget( &m_tabWidget ); if ( !m_installOptions ) { m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); m_tabWidget.setCurrentTab( tr( "Servers" ) ); } else { m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); } } void OIpkgConfigDlg::accept() { // Save server, destination and proxy configuration if ( !m_installOptions ) { // Update proxy information before saving settings OConfItem *confItem = m_ipkg->findConfItem( OConfItem::Option, "http_proxy" ); if ( confItem ) { confItem->setValue( m_proxyHttpServer->text() ); confItem->setActive( m_proxyHttpActive->isChecked() ); } else m_configs->append( new OConfItem( OConfItem::Option, "http_proxy", m_proxyHttpServer->text(), QString::null, m_proxyHttpActive->isChecked() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); if ( confItem ) { confItem->setValue( m_proxyFtpServer->text() ); confItem->setActive( m_proxyFtpActive->isChecked() ); } else m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy", m_proxyFtpServer->text(), QString::null, m_proxyFtpActive->isChecked() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); if ( confItem ) confItem->setValue( m_proxyUsername->text() ); else m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", m_proxyUsername->text() ) ); confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); if ( confItem ) diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 9e23b62..88381ab 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h @@ -1,128 +1,126 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #ifndef OIPKGCONFIGDLG_H #define OIPKGCONFIGDLG_H #include <opie2/otabwidget.h> #include <qdialog.h> #include <qlayout.h> #include "oipkg.h" class QCheckBox; class QComboBox; class QLineEdit; class QListBox; class QPushButton; class OIpkgConfigDlg : public QDialog { Q_OBJECT public: OIpkgConfigDlg( OIpkg *ipkg = 0l, bool installOptions = false, QWidget *parent = 0l ); protected slots: void accept(); void reject(); private: OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options OConfItemList *m_configs; // Local list of configuration items bool m_installOptions; // If true, will only display the Options tab // Server/Destination cached information int m_serverCurrent; // Index of currently selected server in m_serverList int m_destCurrent; // Index of currently selected destination in m_destList // UI controls QVBoxLayout m_layout; // Main dialog layout control Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control QWidget *m_serverWidget; // Widget containing server configuration controls QWidget *m_destWidget; // Widget containing destination configuration controls QWidget *m_proxyWidget; // Widget containing proxy configuration controls QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls // Server configuration UI controls QListBox *m_serverList; // Server list selection QPushButton *m_serverEditBtn; // Server edit button QPushButton *m_serverDeleteBtn; // Server edit button // Destination configuration UI controls QListBox *m_destList; // Destination list selection QPushButton *m_destEditBtn; // Destination edit button QPushButton *m_destDeleteBtn; // Destination edit button // Proxy server configuration UI controls QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box QLineEdit *m_proxyFtpServer; // FTP proxy server edit box QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box QLineEdit *m_proxyUsername; // Proxy server username edit box QLineEdit *m_proxyPassword; // Proxy server password edit box // Options configuration UI controls QCheckBox *m_optForceDepends; // Force depends ipkg option checkbox QCheckBox *m_optForceReinstall; // Force reinstall ipkg option checkbox QCheckBox *m_optForceRemove; // Force remove ipkg option checkbox QCheckBox *m_optForceOverwrite; // Force overwrite ipkg option checkbox QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection QLineEdit *m_optSourceLists; // Ipkg source lists destination directory void initServerWidget(); void initDestinationWidget(); void initProxyWidget(); void initOptionsWidget(); void initData(); private slots: void slotServerSelected( int index ); void slotServerNew(); void slotServerEdit(); void slotServerDelete(); void slotDestSelected( int index ); void slotDestNew(); void slotDestEdit(); void slotDestDelete(); void slotOptSelectSourceListsPath(); }; class OIpkgServerDlg : public QDialog { Q_OBJECT diff --git a/noncore/settings/packagemanager/opackage.cpp b/noncore/settings/packagemanager/opackage.cpp index 37963fa..f3c2024 100644 --- a/noncore/settings/packagemanager/opackage.cpp +++ b/noncore/settings/packagemanager/opackage.cpp @@ -1,46 +1,45 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "opackage.h" OPackage::OPackage( const QString &name, const QString &version, const QString &versionInstalled, const QString &source, const QString &destination, const QString &category, const QString &information, const QString &files ) : m_name( name ) , m_version( version ) , m_versionInstalled( versionInstalled ) , m_source( source ) , m_destination( destination ) , m_category( category ) , m_information( information ) , m_files( files ) { } diff --git a/noncore/settings/packagemanager/opackage.h b/noncore/settings/packagemanager/opackage.h index fbd9ec0..4da5a2b 100644 --- a/noncore/settings/packagemanager/opackage.h +++ b/noncore/settings/packagemanager/opackage.h @@ -1,81 +1,80 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OPACKAGE_H #define OPACKAGE_H #include <qlist.h> #include <qstring.h> class OPackage { public: enum Command { Install, Remove, Update, Upgrade, Download, Info, Files, Version, NotDefined }; OPackage( const QString &name= QString::null, const QString &version= QString::null, const QString &versionInstalled= QString::null, const QString &source= QString::null, const QString &destination= QString::null, const QString &category = "misc", const QString &information = QString::null, const QString &files = QString::null ); const QString &name() { return m_name; } const QString &version() { return m_version; } const QString &versionInstalled() { return m_versionInstalled; } const QString &source() { return m_source; } const QString &destination() { return m_destination; } const QString &category() { return m_category; } const QString &information() { return m_information; } const QString &files() { return m_files; } void setName( const QString &name ) { m_name = name; } void setVersion( const QString &version ) { m_version = version; } void setVersionInstalled( const QString &version ) { m_versionInstalled = version; } void setSource( const QString &source ) { m_source = source; } void setDestination( const QString &destination ) { m_destination = destination; } void setCategory( const QString &category ) { m_category = category; } void setInformation( const QString &information ) { m_information = information; } void setFiles( const QString &files ) { m_files = files; } private: QString m_name; // Name of item QString m_version; // Available version number of item QString m_versionInstalled; // Installed version number of item, null if not installed QString m_source; // Source feed of available version QString m_destination; // Location item is installed to, null if not installed QString m_category; // Item category QString m_information; // Package information QString m_files; // File list information }; typedef QList<OPackage> OPackageList; typedef QListIterator<OPackage> OPackageListIterator; #endif diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index c9fdec1..abd8852 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -1,125 +1,124 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "opackagemanager.h" #include "oipkgconfigdlg.h" #include <qpe/qpeapplication.h> #include <ctype.h> OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) : QObject( parent, name ) , m_config( config ) , m_ipkg( m_config, this ) , m_packages( 9973 ) , m_categories() { m_packages.setAutoDelete( true ); } void OPackageManager::loadAvailablePackages() { m_packages.clear(); OConfItemList *serverList = m_ipkg.servers(); if ( serverList ) { // Initialize status messaging emit initStatus( serverList->count() ); int serverCount = 0; bool categoryAdded = false; for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) { OConfItem *server = serverIt.current(); // Process server only if it is active if ( server->active() ) { // Update status QString status = tr( "Reading available packages:\n\t" ); status.append( server->name() ); emit statusText( status ); ++serverCount; emit statusBar( serverCount ); qApp->processEvents(); OPackageList *packageList = m_ipkg.availablePackages( server->name() ); if ( packageList ) { for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) { OPackage *package = packageIt.current(); // Load package info if ( !m_packages.find( package->name() ) ) m_packages.insert( package->name(), package ); else { // If new package is newer version, replace existing package OPackage *currPackage = m_packages[package->name()]; if ( compareVersions( package->version(), currPackage->version() ) == 1 ) m_packages.replace( package->name(), package ); } // Add category to list if it doesn't already exist if ( m_categories.grep( package->category() ).isEmpty() ) { m_categories << package->category(); categoryAdded = true; } } } } } delete serverList; // Sort category list if categories were added if ( categoryAdded ) m_categories.sort(); } } void OPackageManager::loadInstalledPackages() { OConfItemList *destList = m_ipkg.destinations(); if ( destList ) { // Initialize status messaging emit initStatus( destList->count() ); int destCount = 0; bool categoryAdded = false; diff --git a/noncore/settings/packagemanager/opackagemanager.h b/noncore/settings/packagemanager/opackagemanager.h index bc394e8..60c1643 100644 --- a/noncore/settings/packagemanager/opackagemanager.h +++ b/noncore/settings/packagemanager/opackagemanager.h @@ -1,95 +1,94 @@ /* - This file is part of the Opie Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OPACKAGEMANAGER_H #define OPACKAGEMANAGER_H #include "oipkg.h" #include <qpe/config.h> #include <qdict.h> #include <qobject.h> #include <qstringlist.h> class OPackageManager : public QObject { Q_OBJECT public: OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); void loadAvailablePackages(); void loadInstalledPackages(); enum Status { All, NotInstalled, Installed, Updated, NotDefined }; OPackageList *packages(); OPackageList *filterPackages( const QString &name = QString::null, const QString &server = QString::null, const QString &destination = QString::null, Status status = NotDefined, const QString &category = QString::null ); const QStringList &categories() { return m_categories; } QStringList servers(); QStringList destinations(); int compareVersions( const QString &version1, const QString &version2 ); OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, const QString &name = QString::null ); OPackage *findPackage( const QString &name = QString::null ); bool configureDlg( bool installOptions = false ); void saveSettings(); bool executeCommand( OPackage::Command command = OPackage::NotDefined, const QStringList ¶meters = QStringList(), const QString &destination = QString::null, const QObject *receiver = 0x0, const char *slotOutput = 0x0, bool rawOutput = true ); private: Config *m_config; // Pointer to application configuration file OIpkg m_ipkg; // OIpkg object to retrieve package/configuration information QDict<OPackage> m_packages; // Global list of available packages QStringList m_categories; // List of all categories void parseVersion( const QString &verstr, int *epoch, QString *version, QString *revision ); int verrevcmp( const char *val, const char *ref ); signals: void initStatus( int numSteps ); void statusText( const QString &status ); void statusBar( int currStep ); }; #endif diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 3eef939..e034f34 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "packageinfodlg.h" #include "opackage.h" #include "opackagemanager.h" #include <opie2/otabwidget.h> #include <qpe/resource.h> #include <qlayout.h> #include <qpushbutton.h> #include <qwhatsthis.h> PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) : QWidget( 0l ) , m_packman( pm ) , m_information( this ) , m_files( this ) , m_retrieveFiles( 0l ) { // Initialize UI if ( parent ) parent->setCaption( package ); QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this ); layout->addWidget( tabWidget ); // Information tab QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) ); m_information.reparent( tabWidget, QPoint( 0, 0 ) ); m_information.setReadOnly( true ); tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); // Retrive package information m_package = m_packman->findPackage( package ); if ( !m_package ) { m_information.setText( tr( "Unable to retrieve package information." ) ); return; } // Display package information if ( !m_package->information().isNull() ) m_information.setText( m_package->information() ); else { // Package information is not cached, retrieve it QStringList list( package ); m_packman->executeCommand( OPackage::Info, list, QString::null, this, SLOT(slotInfo(const QString &)), true ); } // Files tab (display only if package is installed) if ( !m_package->versionInstalled().isNull() ) { QWidget *filesWidget = new QWidget( tabWidget ); QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); m_files.reparent( filesWidget, QPoint( 0, 0 ) ); m_files.setReadOnly( true ); filesLayout->addWidget( &m_files ); // If file list is already cached, display if ( !m_package->files().isNull() ) m_files.setText( m_package->files() ); else { m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Retrieve file list" ), filesWidget ); QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) ); filesLayout->addWidget( m_retrieveFiles ); connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); } tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); tabWidget->setCurrentTab( tr( "Information" ) ); } else m_files.hide(); } PackageInfoDlg::~PackageInfoDlg() { if ( !m_package ) return; // Cache package information if ( !m_information.text().isNull() ) m_package->setInformation( m_information.text() ); // Cache package file list if ( !m_files.text().isEmpty() ) diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h index 2962f9a..e4c6bba 100644 --- a/noncore/settings/packagemanager/packageinfodlg.h +++ b/noncore/settings/packagemanager/packageinfodlg.h @@ -1,66 +1,67 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef PACKAGEINFODLG_H #define PACKAGEINFODLG_H #include "opackage.h" #include <qmultilineedit.h> #include <qwidget.h> class QPushButton; class OPackage; class OPackageManager; class PackageInfoDlg : public QWidget { Q_OBJECT public: PackageInfoDlg( QWidget *parent = 0l, OPackageManager *pm = 0l, const QString &package = QString::null ); ~PackageInfoDlg(); private: OPackageManager *m_packman; // Pointer to application instance of package manager OPackage *m_package; // Pointer to package to display information for // UI controls QMultiLineEdit m_information; // Multi-line edit to display package information QMultiLineEdit m_files; // Multi-line edit to display package file list QPushButton *m_retrieveFiles; // Push button to retrieve file list private slots: void slotBtnFileScan(); void slotInfo( const QString &info ); void slotFiles( const QString &filelist ); }; #endif diff --git a/noncore/settings/packagemanager/promptdlg.cpp b/noncore/settings/packagemanager/promptdlg.cpp index 841b98e..5053caa 100644 --- a/noncore/settings/packagemanager/promptdlg.cpp +++ b/noncore/settings/packagemanager/promptdlg.cpp @@ -1,123 +1,124 @@ /* - This file is part of the OPIE Project - - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> - .=l. - .>+-= - _;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: - : = ...= . :.=- You should have received a copy of the GNU - -. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, + Â Â Â Â Â Â Â Â This file is part of the Opie Project + + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. + .=l. +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "promptdlg.h" #include <qpe/qpeapplication.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> #include <qwidgetlist.h> PromptDlg::PromptDlg( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, QWidget *parent ) : QWidget( parent, QString::null, WType_Modal | WType_TopLevel | WStyle_Dialog ) , m_btnClicked( -1 ) { setCaption( caption ); QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 2 ); QLabel *label = new QLabel( text, this ); label->setAlignment( AlignCenter | WordBreak ); layout->addMultiCellWidget( label, 0, 0, 0, 1 ); QPushButton *btn = new QPushButton( btn1, this ); layout->addWidget( btn, 1, 0 ); connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn1Clicked()) ); btn = new QPushButton( btn2, this ); layout->addWidget( btn, 1, 1 ); connect( btn, SIGNAL(clicked()), this, SLOT(slotBtn2Clicked()) ); } int PromptDlg::display() { // Determine position of dialog. Derived from QT's QDialog::show() method. QWidget *w = parentWidget(); QPoint p( 0, 0 ); int extraw = 0, extrah = 0; QWidget * desk = QApplication::desktop(); if ( w ) w = w->topLevelWidget(); QWidgetList *list = QApplication::topLevelWidgets(); QWidgetListIt it( *list ); while ( (extraw == 0 || extrah == 0) && it.current() != 0 ) { int w, h; QWidget * current = it.current(); ++it; w = current->geometry().x() - current->x(); h = current->geometry().y() - current->y(); extraw = QMAX( extraw, w ); extrah = QMAX( extrah, h ); } delete list; // sanity check for decoration frames. With embedding, we // might get extraordinary values if ( extraw >= 10 || extrah >= 40 ) extraw = extrah = 0; if ( w ) { // Use mapToGlobal rather than geometry() in case w might // be embedded in another application QPoint pp = w->mapToGlobal( QPoint(0,0) ); p = QPoint( pp.x() + w->width()/2, pp.y() + w->height()/ 2 ); } else p = QPoint( desk->width()/2, desk->height()/2 ); p = QPoint( p.x()-width()/2 - extraw, p.y()-height()/2 - extrah ); if ( p.x() + extraw + width() > desk->width() ) p.setX( desk->width() - width() - extraw ); if ( p.x() < 0 ) p.setX( 0 ); if ( p.y() + extrah + height() > desk->height() ) p.setY( desk->height() - height() - extrah ); if ( p.y() < 0 ) p.setY( 0 ); move( p ); show(); // Enter event loop for modality qApp->enter_loop(); return m_btnClicked; } int PromptDlg::ask( const QString &caption, const QString &text, const QString &btn1, const QString &btn2, QWidget *parent ) { diff --git a/noncore/settings/packagemanager/promptdlg.h b/noncore/settings/packagemanager/promptdlg.h index f7bc0c0..9f870fa 100644 --- a/noncore/settings/packagemanager/promptdlg.h +++ b/noncore/settings/packagemanager/promptdlg.h @@ -1,59 +1,60 @@ /* - This file is part of the OPIE Project + Â Â Â Â Â Â Â Â This file is part of the Opie Project - =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> + =. .=l. - .>+-= -_;:, .> :=|. This file is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This file is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General -..}^=.= = ; Public License for more details. -++= -. .` .: -: = ...= . :.=- You should have received a copy of the GNU --. .:....=;==+<; General Public License along with this file; - -_. . . )=. = see the file COPYING. If not, write to the - -- :-=` Free Software Foundation, Inc., - 59 Temple Place - Suite 330, +Â Â Â Â Â Â .>+-= +Â _;:, Â Â .> Â Â :=|. This program is free software; you can +.> <`_, Â > Â . Â <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public +.="- .-=="i, Â Â .._ License as published by the Free Software +Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, +Â Â Â ._= =} Â Â Â : or (at your option) any later version. +Â Â .%`+i> Â Â Â _;_. +Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that +Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; + : .. Â Â .:, Â Â . . . without even the implied warranty of +Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A +Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= Â Â Â = Â Â Â ; Library General Public License for more +++= Â -. Â Â .` Â Â .: details. +: Â Â = Â ...= . :.=- +Â -. Â .:....=;==+<; You should have received a copy of the GNU +Â -_. . . Â )=. Â = Library General Public License along with +Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef PROMPTDLG_H #define PROMPTDLG_H #include <qwidget.h> class PromptDlg : public QWidget { Q_OBJECT public: PromptDlg( const QString &caption = QString::null, const QString &text = QString::null, const QString &btn1 = QString::null, const QString &btn2 = QString::null, QWidget *parent = 0x0 ); int display(); int btnPressed() { return m_btnClicked; } static int ask( const QString &caption = QString::null, const QString &text = QString::null, const QString &btn1 = QString::null, const QString &btn2 = QString::null, QWidget *parent = 0x0 ); private: int m_btnClicked; // Indicator for which button was pressed private slots: void slotBtn1Clicked(); void slotBtn2Clicked(); }; #endif |