summaryrefslogtreecommitdiff
authordrw <drw>2003-04-22 02:08:38 (UTC)
committer drw <drw>2003-04-22 02:08:38 (UTC)
commitf37fda5887250b25033120021aed2f1e48f48b1b (patch) (unidiff)
treefa97b82d00209bc72d120d15792d107cfb03736b
parent2d4cf8a85edc83b72855854b0bd337d2993df95b (diff)
downloadopie-f37fda5887250b25033120021aed2f1e48f48b1b.zip
opie-f37fda5887250b25033120021aed2f1e48f48b1b.tar.gz
opie-f37fda5887250b25033120021aed2f1e48f48b1b.tar.bz2
Now display package information in separate window...easier for those long descriptions. Also use click and hold to display info, not double-click.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro2
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp50
-rw-r--r--noncore/settings/aqpkg/mainwin.h2
-rw-r--r--noncore/settings/aqpkg/packagewin.cpp119
-rw-r--r--noncore/settings/aqpkg/packagewin.h45
5 files changed, 180 insertions, 38 deletions
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro
index 5b5d506..d241d1b 100644
--- a/noncore/settings/aqpkg/aqpkg.pro
+++ b/noncore/settings/aqpkg/aqpkg.pro
@@ -5,6 +5,7 @@ HEADERS = global.h \
5 datamgr.h \ 5 datamgr.h \
6 settingsimpl.h \ 6 settingsimpl.h \
7 ipkg.h \ 7 ipkg.h \
8 packagewin.h \
8 package.h \ 9 package.h \
9 installdlgimpl.h \ 10 installdlgimpl.h \
10 instoptionsimpl.h \ 11 instoptionsimpl.h \
@@ -20,6 +21,7 @@ SOURCES = mainwin.cpp \
20 settingsimpl.cpp \ 21 settingsimpl.cpp \
21 ipkg.cpp \ 22 ipkg.cpp \
22 main.cpp \ 23 main.cpp \
24 packagewin.cpp \
23 package.cpp \ 25 package.cpp \
24 installdlgimpl.cpp \ 26 installdlgimpl.cpp \
25 instoptionsimpl.cpp \ 27 instoptionsimpl.cpp \
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index fb40d52..1aec6a8 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -48,6 +48,7 @@
48#include "installdlgimpl.h" 48#include "installdlgimpl.h"
49#include "letterpushbutton.h" 49#include "letterpushbutton.h"
50#include "mainwin.h" 50#include "mainwin.h"
51#include "packagewin.h"
51#include "settingsimpl.h" 52#include "settingsimpl.h"
52#include "utils.h" 53#include "utils.h"
53 54
@@ -230,7 +231,7 @@ void MainWindow :: initMainWidget()
230 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); 231 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow );
231 232
232 serversList = new QComboBox( networkPkgWindow ); 233 serversList = new QComboBox( networkPkgWindow );
233 connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); 234 connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) );
234 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); 235 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) );
235 236
236 installedIcon = Resource::loadPixmap( "installed" ); 237 installedIcon = Resource::loadPixmap( "installed" );
@@ -239,6 +240,9 @@ void MainWindow :: initMainWidget()
239 packagesList = new QListView( networkPkgWindow ); 240 packagesList = new QListView( networkPkgWindow );
240 packagesList->addColumn( tr( "Packages" ), 225 ); 241 packagesList->addColumn( tr( "Packages" ), 225 );
241 QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\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\nClick inside the box at the left to select a package." ) ); 242 QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\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\nClick inside the box at the left to select a package." ) );
243 QPEApplication::setStylusOperation( packagesList->viewport(), QPEApplication::RightOnHold );
244 connect( packagesList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)),
245 this, SLOT(slotDisplayPackage(QListViewItem *)) );
242 246
243 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); 247 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 );
244 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); 248 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 );
@@ -671,49 +675,12 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
671 { 675 {
672 item->setPixmap( 0, installedIcon ); 676 item->setPixmap( 0, installedIcon );
673 } 677 }
674
675 QString destName = "";
676 if ( package->getLocalPackage() )
677 {
678 if ( package->getLocalPackage()->getInstalledTo() )
679 destName = package->getLocalPackage()->getInstalledTo()->getDestinationName();
680 }
681 else
682 {
683 if ( package->getInstalledTo() )
684 destName = package->getInstalledTo()->getDestinationName();
685 }
686 if ( destName != "" )
687 new QCheckListItem( item, QString( tr( "Installed To - %1" ).arg( destName ) ) );
688 } 678 }
689 else 679 else
690 { 680 {
691 item->setPixmap( 0, nullIcon ); 681 item->setPixmap( 0, nullIcon );
692 } 682 }
693 683
694 if ( !package->isPackageStoredLocally() )
695 {
696 new QCheckListItem( item, QString( tr( "Description - %1" ).arg( package->getDescription() ) ) );
697 new QCheckListItem( item, QString( tr( "Size - %1" ).arg( package->getPackageSize() ) ) );
698 new QCheckListItem( item, QString( tr( "Section - %1" ).arg( package->getSection() ) ) );
699 }
700 else
701 new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( package->getFilename() ) ) );
702
703 if ( serverName == LOCAL_SERVER )
704 {
705 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getVersion() ) ) );
706 }
707 else
708 {
709 new QCheckListItem( item, QString( tr( "V. Available - %1" ).arg( package->getVersion() ) ) );
710 if ( package->getLocalPackage() )
711 {
712 if ( package->isInstalled() )
713 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getInstalledVersion() ) ) );
714 }
715 }
716
717 packagesList->insertItem( item ); 684 packagesList->insertItem( item );
718 } 685 }
719 686
@@ -1182,3 +1149,10 @@ void MainWindow :: letterPushed( QString t )
1182 item = (QCheckListItem *)packagesList->firstChild(); 1149 item = (QCheckListItem *)packagesList->firstChild();
1183 } while ( item != start); 1150 } while ( item != start);
1184} 1151}
1152
1153void MainWindow :: slotDisplayPackage( QListViewItem *item )
1154{
1155 QString itemstr( ((QCheckListItem*)item)->text() );
1156 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
1157 p->showMaximized();
1158}
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index 4b044de..0295519 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -31,6 +31,7 @@ class QComboBox;
31class QLabel; 31class QLabel;
32class QLineEdit; 32class QLineEdit;
33class QListView; 33class QListView;
34class QListViewItem;
34class QToolBar; 35class QToolBar;
35class QProgressBar; 36class QProgressBar;
36class QWidgetStack; 37class QWidgetStack;
@@ -135,5 +136,6 @@ private slots:
135 void downloadPackage(); 136 void downloadPackage();
136 void applyChanges(); 137 void applyChanges();
137 void letterPushed( QString t ); 138 void letterPushed( QString t );
139 void slotDisplayPackage( QListViewItem * );
138}; 140};
139#endif 141#endif
diff --git a/noncore/settings/aqpkg/packagewin.cpp b/noncore/settings/aqpkg/packagewin.cpp
new file mode 100644
index 0000000..f00453e
--- a/dev/null
+++ b/noncore/settings/aqpkg/packagewin.cpp
@@ -0,0 +1,119 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "packagewin.h"
30#include "package.h"
31#include "datamgr.h"
32
33#include <qpe/resource.h>
34
35#include <qlabel.h>
36#include <qlayout.h>
37#include <qpushbutton.h>
38#include <qstring.h>
39
40PackageWindow::PackageWindow( Package *package, const QString &server )
41 : QWidget( 0, 0, 0 )
42{
43 QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 );
44 QString str;
45 if ( package )
46 {
47 setCaption( package->getPackageName() );
48 QString destName;
49 if ( package->getLocalPackage() )
50 {
51 if ( package->getLocalPackage()->getInstalledTo() )
52 destName = package->getLocalPackage()->getInstalledTo()->getDestinationName();
53 }
54 else
55 {
56 if ( package->getInstalledTo() )
57 destName = package->getInstalledTo()->getDestinationName();
58 }
59
60 if ( !package->isPackageStoredLocally() )
61 {
62 str.append( tr( "<b>Description</b> - " ) );
63 str.append( package->getDescription() );
64 if ( !destName.isNull() )
65 {
66 str.append( tr( "<p><b>Installed To</b> - " ) );
67 str.append( destName );
68 }
69 str.append( tr( "<p><b>Size</b> - " ) );
70 str.append( package->getPackageSize() );
71 str.append( tr( "<p><b>Section</b> - " ) );
72 str.append( package->getSection() );
73 }
74 else
75 {
76 str.append( tr( "<p><b>Filename</b> - " ) );
77 str.append( package->getFilename() );
78 }
79
80 if ( server == LOCAL_SERVER )
81 {
82 str.append( tr( "<p><b>Version Installed</b> - " ) );
83 str.append( package->getVersion() );
84 }
85 else
86 {
87 str.append( tr( "<p><b>Version Available</b> - " ) );
88 str.append( package->getVersion() );
89 if ( package->getLocalPackage() )
90 {
91 if ( package->isInstalled() )
92 {
93 str.append( tr( "<p><b>Version Installed</b> - " ) );
94 str.append( package->getInstalledVersion() );
95 }
96 }
97 }
98 }
99 else
100 {
101 setCaption( tr( "Package Information" ) );
102 str = tr( "Package information is unavailable" );
103 }
104
105 QLabel *l = new QLabel( str, this );
106 l->setTextFormat( Qt::RichText );
107 l->setAlignment( Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak );
108 layout->addWidget( l );
109
110 QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this );
111 layout->addWidget( btn );
112 connect( btn, SIGNAL( clicked() ), this, SLOT( close() ) );
113
114}
115
116PackageWindow::~PackageWindow()
117{
118}
119
diff --git a/noncore/settings/aqpkg/packagewin.h b/noncore/settings/aqpkg/packagewin.h
new file mode 100644
index 0000000..c1943b5
--- a/dev/null
+++ b/noncore/settings/aqpkg/packagewin.h
@@ -0,0 +1,45 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef PACKAGEWIN_H
30#define PACKAGEWIN_H
31
32#include <qwidget.h>
33
34class Package;
35
36class PackageWindow :public QWidget
37{
38 Q_OBJECT
39public:
40
41 PackageWindow( Package * = 0x0, const QString & = QString::null );
42 ~PackageWindow();
43};
44
45#endif \ No newline at end of file