summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp20
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp16
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp38
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp35
4 files changed, 61 insertions, 48 deletions
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp
index 61e1f93..217d2c9 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.cpp
+++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp
@@ -6,102 +6,108 @@
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include <iostream> 30#include "categoryfilterimpl.h"
31using namespace std;
32 31
32/* OPIE */
33#include <qpe/qpeapplication.h>
34
35/* QT */
33#include <qgroupbox.h> 36#include <qgroupbox.h>
34#include <qlayout.h> 37#include <qlayout.h>
35#include <qlistbox.h> 38#include <qlistbox.h>
36#include <qstring.h> 39#include <qstring.h>
37 40
38#include "categoryfilterimpl.h" 41/* STD */
42#include <iostream>
43using namespace std;
44
39 45
40CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) 46CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name )
41 : QDialog( parent, name, true ) 47 : QDialog( parent, name, true )
42{ 48{
43 setCaption( tr( "Category Filter" ) ); 49 setCaption( tr( "Category Filter" ) );
44 50
45 QVBoxLayout *layout = new QVBoxLayout( this ); 51 QVBoxLayout *layout = new QVBoxLayout( this );
46 layout->setMargin( 2 ); 52 layout->setMargin( 2 );
47 layout->setSpacing( 4 ); 53 layout->setSpacing( 4 );
48 54
49 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this ); 55 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this );
50 grpbox->layout()->setSpacing( 2 ); 56 grpbox->layout()->setSpacing( 2 );
51 grpbox->layout()->setMargin( 4 ); 57 grpbox->layout()->setMargin( 4 );
52 layout->addWidget( grpbox ); 58 layout->addWidget( grpbox );
53 59
54 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); 60 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
55 61
56 lstCategories = new QListBox( grpbox ); 62 lstCategories = new QListBox( grpbox );
57 lstCategories->setSelectionMode( QListBox::Multi ); 63 lstCategories->setSelectionMode( QListBox::Multi );
58 grplayout->addWidget( lstCategories ); 64 grplayout->addWidget( lstCategories );
59 65
60 // Split up categories and add them to the listbox 66 // Split up categories and add them to the listbox
61 int start = 1; 67 int start = 1;
62 68
63 QString item; 69 QString item;
64 int end; 70 int end;
65 QString finditem; 71 QString finditem;
66 do 72 do
67 { 73 {
68 end = categories.find( "#", start ); 74 end = categories.find( "#", start );
69 item = categories.mid( start, end - start ); 75 item = categories.mid( start, end - start );
70 if ( item != "" ) 76 if ( item != "" )
71 { 77 {
72 lstCategories->insertItem( item ); 78 lstCategories->insertItem( item );
73 finditem = QString( "#%1#" ).arg( item ); 79 finditem = QString( "#%1#" ).arg( item );
74 if ( selectedCategories.find( finditem ) != -1 ) 80 if ( selectedCategories.find( finditem ) != -1 )
75 lstCategories->setSelected( lstCategories->count()-1, true ); 81 lstCategories->setSelected( lstCategories->count()-1, true );
76 } 82 }
77 83
78 start = end + 1; 84 start = end + 1;
79 } while ( start < (int)categories.length() ); 85 }
86 while ( start < (int)categories.length() );
80 87
81 lstCategories->sort( true ); 88 lstCategories->sort( true );
82 89
83 showMaximized(); 90 QPEApplication::showDialog( this );
84} 91}
85 92
86CategoryFilterImpl :: ~CategoryFilterImpl() 93CategoryFilterImpl :: ~CategoryFilterImpl()
87{ 94{}
88}
89 95
90QString CategoryFilterImpl :: getSelectedFilter() 96QString CategoryFilterImpl :: getSelectedFilter()
91{ 97{
92 // Grab cetegories from listbox 98 // Grab cetegories from listbox
93 QString ret = "#"; 99 QString ret = "#";
94 100
95 for ( int i = 0 ; i < (int)lstCategories->count() ; ++i ) 101 for ( int i = 0 ; i < (int)lstCategories->count() ; ++i )
96 { 102 {
97 if ( lstCategories->isSelected( i ) ) 103 if ( lstCategories->isSelected( i ) )
98 { 104 {
99 ret.append( lstCategories->text( i ) ); 105 ret.append( lstCategories->text( i ) );
100 ret.append( "#" ); 106 ret.append( "#" );
101 } 107 }
102 } 108 }
103 109
104 if ( ret == "#" ) 110 if ( ret == "#" )
105 ret = ""; 111 ret = "";
106 return ret; 112 return ret;
107} 113}
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp
index 9d52013..126e3b9 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.cpp
+++ b/noncore/settings/aqpkg/instoptionsimpl.cpp
@@ -6,62 +6,65 @@
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "global.h"
31#include "instoptionsimpl.h"
32#include "ipkg.h"
33
34/* OPIE */
30#ifdef QWS 35#ifdef QWS
31#include <qpe/config.h> 36#include <qpe/config.h>
32#endif 37#endif
38#include <qpe/qpeapplication.h>
33 39
40/* QT */
34#include <qcheckbox.h> 41#include <qcheckbox.h>
35#include <qcombobox.h> 42#include <qcombobox.h>
36#include <qgroupbox.h> 43#include <qgroupbox.h>
37#include <qlabel.h> 44#include <qlabel.h>
38#include <qlayout.h> 45#include <qlayout.h>
39 46
40#include "global.h"
41#include "instoptionsimpl.h"
42#include "ipkg.h"
43
44InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) 47InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
45 : QDialog( parent, name, modal, fl ) 48 : QDialog( parent, name, modal, fl )
46{ 49{
47 setCaption( tr( "Options" ) ); 50 setCaption( tr( "Options" ) );
48 51
49 QVBoxLayout *layout = new QVBoxLayout( this ); 52 QVBoxLayout *layout = new QVBoxLayout( this );
50 layout->setMargin( 2 ); 53 layout->setMargin( 2 );
51 layout->setSpacing( 4 ); 54 layout->setSpacing( 4 );
52 55
53 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this ); 56 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this );
54 grpbox->layout()->setSpacing( 2 ); 57 grpbox->layout()->setSpacing( 2 );
55 grpbox->layout()->setMargin( 4 ); 58 grpbox->layout()->setMargin( 4 );
56 layout->addWidget( grpbox ); 59 layout->addWidget( grpbox );
57 60
58 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); 61 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
59 62
60 forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox ); 63 forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox );
61 grplayout->addWidget( forceDepends ); 64 grplayout->addWidget( forceDepends );
62 65
63 forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox ); 66 forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox );
64 grplayout->addWidget( forceReinstall ); 67 grplayout->addWidget( forceReinstall );
65 68
66 forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox ); 69 forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox );
67 grplayout->addWidget( forceRemove ); 70 grplayout->addWidget( forceRemove );
@@ -74,55 +77,54 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par
74 77
75 verboseIpkg = new QComboBox( grpbox ); 78 verboseIpkg = new QComboBox( grpbox );
76 verboseIpkg->insertItem( tr( "Errors only" ) ); 79 verboseIpkg->insertItem( tr( "Errors only" ) );
77 verboseIpkg->insertItem( tr( "Normal messages" ) ); 80 verboseIpkg->insertItem( tr( "Normal messages" ) );
78 verboseIpkg->insertItem( tr( "Informative messages" ) ); 81 verboseIpkg->insertItem( tr( "Informative messages" ) );
79 verboseIpkg->insertItem( tr( "Troubleshooting output" ) ); 82 verboseIpkg->insertItem( tr( "Troubleshooting output" ) );
80 verboseIpkg->setCurrentItem( verb ); 83 verboseIpkg->setCurrentItem( verb );
81 grplayout->addWidget( verboseIpkg ); 84 grplayout->addWidget( verboseIpkg );
82 85
83 grplayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 86 grplayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
84 87
85 if ( flags & FORCE_DEPENDS ) 88 if ( flags & FORCE_DEPENDS )
86 forceDepends->setChecked( true ); 89 forceDepends->setChecked( true );
87 if ( flags & FORCE_REINSTALL ) 90 if ( flags & FORCE_REINSTALL )
88 forceReinstall->setChecked( true ); 91 forceReinstall->setChecked( true );
89 if ( flags & FORCE_REMOVE ) 92 if ( flags & FORCE_REMOVE )
90 forceRemove->setChecked( true ); 93 forceRemove->setChecked( true );
91 if ( flags & FORCE_OVERWRITE ) 94 if ( flags & FORCE_OVERWRITE )
92 forceOverwrite->setChecked( true ); 95 forceOverwrite->setChecked( true );
93// if ( flags & VERBOSE_WGET ) 96// if ( flags & VERBOSE_WGET )
94 // verboseWget->setChecked( true ); 97 // verboseWget->setChecked( true );
95// if ( flags & MAKE_LINKS ) 98// if ( flags & MAKE_LINKS )
96 // makeLinks->setChecked( true ); 99 // makeLinks->setChecked( true );
97 100
98 showMaximized(); 101 QPEApplication::showDialog( this );
99 102
100} 103}
101 104
102InstallOptionsDlgImpl::~InstallOptionsDlgImpl() 105InstallOptionsDlgImpl::~InstallOptionsDlgImpl()
103{ 106{}
104}
105 107
106 108
107int InstallOptionsDlgImpl :: getFlags() 109int InstallOptionsDlgImpl :: getFlags()
108{ 110{
109 int flags = 0; 111 int flags = 0;
110 112
111 if ( forceDepends->isChecked() ) 113 if ( forceDepends->isChecked() )
112 flags |= FORCE_DEPENDS; 114 flags |= FORCE_DEPENDS;
113 if ( forceReinstall->isChecked() ) 115 if ( forceReinstall->isChecked() )
114 flags |= FORCE_REINSTALL; 116 flags |= FORCE_REINSTALL;
115 if ( forceRemove->isChecked() ) 117 if ( forceRemove->isChecked() )
116 flags |= FORCE_REMOVE; 118 flags |= FORCE_REMOVE;
117 if ( forceOverwrite->isChecked() ) 119 if ( forceOverwrite->isChecked() )
118 flags |= FORCE_OVERWRITE; 120 flags |= FORCE_OVERWRITE;
119 if ( verboseWget->isChecked() ) 121 if ( verboseWget->isChecked() )
120 flags |= VERBOSE_WGET; 122 flags |= VERBOSE_WGET;
121 123
122 return flags; 124 return flags;
123} 125}
124 126
125int InstallOptionsDlgImpl :: getInfoLevel() 127int InstallOptionsDlgImpl :: getInfoLevel()
126{ 128{
127 return verboseIpkg->currentItem(); 129 return verboseIpkg->currentItem();
128} 130}
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index dbe694e..6f5c712 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -6,84 +6,87 @@
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include <linux/limits.h> 30#include "categoryfilterimpl.h"
31#include <unistd.h> 31#include "datamgr.h"
32#include "global.h"
33#include "inputdlg.h"
34#include "ipkg.h"
35#include "installdlgimpl.h"
36#include "letterpushbutton.h"
37#include "mainwin.h"
38#include "packagewin.h"
39#include "settingsimpl.h"
40#include "utils.h"
32 41
42/* OPIE */
33#include <qpe/qcopenvelope_qws.h> 43#include <qpe/qcopenvelope_qws.h>
34#include <qmenubar.h>
35#include <qpe/qpeapplication.h> 44#include <qpe/qpeapplication.h>
36#include <qtoolbar.h>
37#include <qpe/config.h> 45#include <qpe/config.h>
38#include <qpe/resource.h> 46#include <qpe/resource.h>
39 47
48/* QT */
49#include <qmenubar.h>
50#include <qtoolbar.h>
40#include <qaction.h> 51#include <qaction.h>
41#include <qcombobox.h> 52#include <qcombobox.h>
42#include <qfile.h> 53#include <qfile.h>
43#include <qlabel.h> 54#include <qlabel.h>
44#include <qlayout.h> 55#include <qlayout.h>
45#include <qlineedit.h> 56#include <qlineedit.h>
46#include <qlistview.h> 57#include <qlistview.h>
47#include <qmenubar.h> 58#include <qmenubar.h>
48#include <qmessagebox.h> 59#include <qmessagebox.h>
49#include <qpopupmenu.h> 60#include <qpopupmenu.h>
50#include <qprogressbar.h> 61#include <qprogressbar.h>
51#include <qtimer.h> 62#include <qtimer.h>
52#include <qwhatsthis.h> 63#include <qwhatsthis.h>
53#include <qwidgetstack.h> 64#include <qwidgetstack.h>
54 65
55#include "categoryfilterimpl.h" 66/* STD */
56#include "datamgr.h" 67#include <linux/limits.h>
57#include "global.h" 68#include <unistd.h>
58#include "inputdlg.h"
59#include "ipkg.h"
60#include "installdlgimpl.h"
61#include "letterpushbutton.h"
62#include "mainwin.h"
63#include "packagewin.h"
64#include "settingsimpl.h"
65#include "utils.h"
66 69
67extern int compareVersions( const char *v1, const char *v2 ); 70extern int compareVersions( const char *v1, const char *v2 );
68 71
69MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) 72MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
70 :QMainWindow( parent, name, fl || WStyle_ContextHelp ) 73 :QMainWindow( parent, name, fl || WStyle_ContextHelp )
71{ 74{
72 // Disable suspend mode 75 // Disable suspend mode
73 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 76 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
74 77
75 LOCAL_SERVER = QObject::tr( "Installed packages" ); 78 LOCAL_SERVER = QObject::tr( "Installed packages" );
76 LOCAL_IPKGS = QObject::tr( "Local packages" ); 79 LOCAL_IPKGS = QObject::tr( "Local packages" );
77 80
78 setCaption( tr( "AQPkg - Package Manager" ) ); 81 setCaption( tr( "AQPkg - Package Manager" ) );
79 82
80 // Create UI widgets 83 // Create UI widgets
81 initMainWidget(); 84 initMainWidget();
82 initProgressWidget(); 85 initProgressWidget();
83 86
84 // Build menu and tool bars 87 // Build menu and tool bars
85 setToolBarsMovable( FALSE ); 88 setToolBarsMovable( FALSE );
86 89
87 QToolBar *bar = new QToolBar( this ); 90 QToolBar *bar = new QToolBar( this );
88 bar->setHorizontalStretchable( TRUE ); 91 bar->setHorizontalStretchable( TRUE );
89 QMenuBar *mb = new QMenuBar( bar ); 92 QMenuBar *mb = new QMenuBar( bar );
@@ -1160,56 +1163,57 @@ void MainWindow :: letterPushed( QString t )
1160 1163
1161 QCheckListItem *item; 1164 QCheckListItem *item;
1162 if ( start == 0 ) 1165 if ( start == 0 )
1163 { 1166 {
1164 item = (QCheckListItem *)packagesList->firstChild(); 1167 item = (QCheckListItem *)packagesList->firstChild();
1165 start = top; 1168 start = top;
1166 } 1169 }
1167 else 1170 else
1168 item = (QCheckListItem *)start->nextSibling(); 1171 item = (QCheckListItem *)start->nextSibling();
1169 1172
1170 if ( item == 0 ) 1173 if ( item == 0 )
1171 item = (QCheckListItem *)packagesList->firstChild(); 1174 item = (QCheckListItem *)packagesList->firstChild();
1172 do 1175 do
1173 { 1176 {
1174 if ( item->text().lower().startsWith( t.lower() ) ) 1177 if ( item->text().lower().startsWith( t.lower() ) )
1175 { 1178 {
1176 packagesList->setSelected( item, true ); 1179 packagesList->setSelected( item, true );
1177 packagesList->ensureItemVisible( item ); 1180 packagesList->ensureItemVisible( item );
1178 break; 1181 break;
1179 } 1182 }
1180 1183
1181 item = (QCheckListItem *)item->nextSibling(); 1184 item = (QCheckListItem *)item->nextSibling();
1182 if ( !item ) 1185 if ( !item )
1183 item = (QCheckListItem *)packagesList->firstChild(); 1186 item = (QCheckListItem *)packagesList->firstChild();
1184 } while ( item != start); 1187 }
1188 while ( item != start);
1185} 1189}
1186 1190
1187void MainWindow :: slotDisplayPackage( QListViewItem *item ) 1191void MainWindow :: slotDisplayPackage( QListViewItem *item )
1188{ 1192{
1189 QString itemstr( ((QCheckListItem*)item)->text() ); 1193 QString itemstr( ((QCheckListItem*)item)->text() );
1190 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) ); 1194 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
1191 p->showMaximized(); 1195 QPEApplication::showWidget( p );
1192} 1196}
1193 1197
1194QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) 1198QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn )
1195 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog ) 1199 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
1196{ 1200{
1197 setCaption( caption ); 1201 setCaption( caption );
1198 resize( 175, 100 ); 1202 resize( 175, 100 );
1199 1203
1200 QGridLayout *layout = new QGridLayout( this ); 1204 QGridLayout *layout = new QGridLayout( this );
1201 1205
1202 QLabel *l = new QLabel( text, this ); 1206 QLabel *l = new QLabel( text, this );
1203 l->setAlignment( AlignCenter | WordBreak ); 1207 l->setAlignment( AlignCenter | WordBreak );
1204 layout->addMultiCellWidget( l, 0, 0, 0, 1 ); 1208 layout->addMultiCellWidget( l, 0, 0, 0, 1 );
1205 1209
1206 btn1 = new QPushButton( tr( "Remove" ), this ); 1210 btn1 = new QPushButton( tr( "Remove" ), this );
1207 connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); 1211 connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
1208 layout->addWidget( btn1, 1, 0 ); 1212 layout->addWidget( btn1, 1, 0 );
1209 1213
1210 btn2 = new QPushButton( secondbtn, this ); 1214 btn2 = new QPushButton( secondbtn, this );
1211 connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); 1215 connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
1212 layout->addWidget( btn2, 1, 1 ); 1216 layout->addWidget( btn2, 1, 1 );
1213 1217
1214 executing = FALSE; 1218 executing = FALSE;
1215} 1219}
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 4887ceb..9fdf31e 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -6,107 +6,106 @@
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include <fstream> 30#include "settingsimpl.h"
31#include <algorithm> 31#include "global.h"
32using namespace std; 32
33/* OPIE */
34#include <opie/otabwidget.h>
35#ifdef QWS
36#include <qpe/config.h>
37#include <qpe/resource.h>
38#endif
39#include <qpe/qpeapplication.h>
33 40
41/* QT */
34#include <qcheckbox.h> 42#include <qcheckbox.h>
35#include <qgroupbox.h> 43#include <qgroupbox.h>
36#include <qlabel.h> 44#include <qlabel.h>
37#include <qlayout.h> 45#include <qlayout.h>
38#include <qlineedit.h> 46#include <qlineedit.h>
39#include <qlistbox.h> 47#include <qlistbox.h>
40#include <qpushbutton.h> 48#include <qpushbutton.h>
41 49
42#include <opie/otabwidget.h> 50/* STD */
43 51#include <fstream>
44#ifdef QWS 52#include <algorithm>
45#include <qpe/config.h> 53using namespace std;
46#include <qpe/resource.h>
47#endif
48
49#include "settingsimpl.h"
50
51#include "global.h"
52 54
53SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) 55SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl )
54 : QDialog( parent, name, modal, fl ) 56 : QDialog( parent, name, modal, fl )
55{ 57{
56 setCaption( tr( "Configuration" ) ); 58 setCaption( tr( "Configuration" ) );
57 59
58 // Setup layout to make everything pretty 60 // Setup layout to make everything pretty
59 QVBoxLayout *layout = new QVBoxLayout( this ); 61 QVBoxLayout *layout = new QVBoxLayout( this );
60 layout->setMargin( 2 ); 62 layout->setMargin( 2 );
61 layout->setSpacing( 4 ); 63 layout->setSpacing( 4 );
62 64
63 // Setup tabs for all info 65 // Setup tabs for all info
64 OTabWidget *tabwidget = new OTabWidget( this ); 66 OTabWidget *tabwidget = new OTabWidget( this );
65 layout->addWidget( tabwidget ); 67 layout->addWidget( tabwidget );
66 68
67 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); 69 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) );
68 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); 70 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) );
69 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); 71 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) );
70 tabwidget->setCurrentTab( tr( "Servers" ) ); 72 tabwidget->setCurrentTab( tr( "Servers" ) );
71 73
72 dataMgr = dataManager; 74 dataMgr = dataManager;
73 setupData(); 75 setupData();
74 changed = false; 76 changed = false;
75 newserver = false; 77 newserver = false;
76 newdestination = false; 78 newdestination = false;
77} 79}
78 80
79SettingsImpl :: ~SettingsImpl() 81SettingsImpl :: ~SettingsImpl()
80{ 82{
81
82} 83}
83 84
84bool SettingsImpl :: showDlg() 85bool SettingsImpl :: showDlg()
85{ 86{
86 showMaximized(); 87 QPEApplication::execDialog( this );
87 exec();
88
89 if ( changed ) 88 if ( changed )
90 dataMgr->writeOutIpkgConf(); 89 dataMgr->writeOutIpkgConf();
91 90
92 return changed; 91 return changed;
93} 92}
94 93
95QWidget *SettingsImpl :: initServerTab() 94QWidget *SettingsImpl :: initServerTab()
96{ 95{
97 QWidget *control = new QWidget( this ); 96 QWidget *control = new QWidget( this );
98 97
99 QVBoxLayout *vb = new QVBoxLayout( control ); 98 QVBoxLayout *vb = new QVBoxLayout( control );
100 99
101 QScrollView *sv = new QScrollView( control ); 100 QScrollView *sv = new QScrollView( control );
102 vb->addWidget( sv, 0, 0 ); 101 vb->addWidget( sv, 0, 0 );
103 sv->setResizePolicy( QScrollView::AutoOneFit ); 102 sv->setResizePolicy( QScrollView::AutoOneFit );
104 sv->setFrameStyle( QFrame::NoFrame ); 103 sv->setFrameStyle( QFrame::NoFrame );
105 104
106 QWidget *container = new QWidget( sv->viewport() ); 105 QWidget *container = new QWidget( sv->viewport() );
107 sv->addChild( container ); 106 sv->addChild( container );
108 107
109 QGridLayout *layout = new QGridLayout( container ); 108 QGridLayout *layout = new QGridLayout( container );
110 layout->setSpacing( 2 ); 109 layout->setSpacing( 2 );
111 layout->setMargin( 4 ); 110 layout->setMargin( 4 );
112 111
@@ -441,53 +440,55 @@ void SettingsImpl :: changeDestinationDetails()
441 { 440 {
442 Destination *d = dataMgr->getDestination( destinations->currentText() ); 441 Destination *d = dataMgr->getDestination( destinations->currentText() );
443 if ( d ) 442 if ( d )
444 { 443 {
445 // Update url 444 // Update url
446 d->setDestinationPath( destinationurl->text() ); 445 d->setDestinationPath( destinationurl->text() );
447 d->linkToRoot( linkToRoot->isChecked() ); 446 d->linkToRoot( linkToRoot->isChecked() );
448 447
449 // Check if server name has changed, if it has then we need to replace the key in the map 448 // Check if server name has changed, if it has then we need to replace the key in the map
450 if ( destinationName != newName ) 449 if ( destinationName != newName )
451 { 450 {
452 // Update server name 451 // Update server name
453 d->setDestinationName( newName ); 452 d->setDestinationName( newName );
454 453
455 // Update list box 454 // Update list box
456 destinations->changeItem( newName, currentSelectedDestination ); 455 destinations->changeItem( newName, currentSelectedDestination );
457 } 456 }
458 457
459#ifdef QWS 458#ifdef QWS
460 QString key = newName; 459 QString key = newName;
461 key += "_linkToRoot"; 460 key += "_linkToRoot";
462 int val = d->linkToRoot(); 461 int val = d->linkToRoot();
463 cfg.writeEntry( key, val ); 462 cfg.writeEntry( key, val );
464#endif 463#endif
464
465 } 465 }
466 } 466 }
467 else 467 else
468 { 468 {
469 dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) ); 469 dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) );
470 destinations->insertItem( newName ); 470 destinations->insertItem( newName );
471 destinations->setCurrentItem( destinations->count() ); 471 destinations->setCurrentItem( destinations->count() );
472 newdestination = false; 472 newdestination = false;
473 473
474#ifdef QWS 474#ifdef QWS
475 QString key = newName; 475 QString key = newName;
476 key += "_linkToRoot"; 476 key += "_linkToRoot";
477 cfg.writeEntry( key, true ); 477 cfg.writeEntry( key, true );
478#endif 478#endif
479
479 } 480 }
480} 481}
481 482
482//------------------ Proxy tab ---------------------- 483//------------------ Proxy tab ----------------------
483void SettingsImpl :: proxyApplyChanges() 484void SettingsImpl :: proxyApplyChanges()
484{ 485{
485 changed = true; 486 changed = true;
486 dataMgr->setHttpProxy( txtHttpProxy->text() ); 487 dataMgr->setHttpProxy( txtHttpProxy->text() );
487 dataMgr->setFtpProxy( txtFtpProxy->text() ); 488 dataMgr->setFtpProxy( txtFtpProxy->text() );
488 dataMgr->setProxyUsername( txtUsername->text() ); 489 dataMgr->setProxyUsername( txtUsername->text() );
489 dataMgr->setProxyPassword( txtPassword->text() ); 490 dataMgr->setProxyPassword( txtPassword->text() );
490 491
491 dataMgr->setHttpProxyEnabled( chkHttpProxyEnabled->isChecked() ); 492 dataMgr->setHttpProxyEnabled( chkHttpProxyEnabled->isChecked() );
492 dataMgr->setFtpProxyEnabled( chkFtpProxyEnabled->isChecked() ); 493 dataMgr->setFtpProxyEnabled( chkFtpProxyEnabled->isChecked() );
493} 494}