-rw-r--r-- | noncore/settings/packagemanager/filterdlg.cpp | 16 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 28 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 41 |
3 files changed, 64 insertions, 21 deletions
diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp index eeed398..70875bd 100644 --- a/noncore/settings/packagemanager/filterdlg.cpp +++ b/noncore/settings/packagemanager/filterdlg.cpp | |||
@@ -1,159 +1,169 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | .=l. | 5 | .=l. |
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 "filterdlg.h" | 30 | #include "filterdlg.h" |
31 | 31 | ||
32 | #include <qwhatsthis.h> | ||
33 | |||
32 | FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, | 34 | FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, |
33 | const QString &server, const QString &destination, | 35 | const QString &server, const QString &destination, |
34 | OPackageManager::Status status, const QString &category ) | 36 | OPackageManager::Status status, const QString &category ) |
35 | : QDialog( parent, QString::null, true ) | 37 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) |
36 | { | 38 | { |
37 | setCaption( tr( "Filter packages" ) ); | 39 | setCaption( tr( "Filter packages" ) ); |
38 | 40 | ||
39 | QVBoxLayout *layout = new QVBoxLayout( this ); | 41 | QVBoxLayout *layout = new QVBoxLayout( this ); |
40 | QScrollView *sv = new QScrollView( this ); | 42 | QScrollView *sv = new QScrollView( this ); |
41 | layout->addWidget( sv, 0, 0 ); | 43 | layout->addWidget( sv, 0, 0 ); |
42 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 44 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
43 | sv->setFrameStyle( QFrame::NoFrame ); | 45 | sv->setFrameStyle( QFrame::NoFrame ); |
44 | QWidget *container = new QWidget( sv->viewport() ); | 46 | QWidget *container = new QWidget( sv->viewport() ); |
45 | sv->addChild( container ); | 47 | sv->addChild( container ); |
46 | layout = new QVBoxLayout( container, 4, 4 ); | 48 | layout = new QVBoxLayout( container, 4, 4 ); |
47 | 49 | ||
48 | // Category | 50 | // Category |
49 | m_categoryCB = new QCheckBox( tr( "Category:" ), container ); | 51 | m_categoryCB = new QCheckBox( tr( "Category:" ), container ); |
52 | QWhatsThis::add( m_categoryCB, tr( "Tap here to filter package list by application category." ) ); | ||
50 | connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); | 53 | connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); |
51 | m_category = new QComboBox( container ); | 54 | m_category = new QComboBox( container ); |
55 | QWhatsThis::add( m_category, tr( "Select the application category to filter by here." ) ); | ||
52 | m_category->insertStringList( pm->categories() ); | 56 | m_category->insertStringList( pm->categories() ); |
53 | initItem( m_category, m_categoryCB, category ); | 57 | initItem( m_category, m_categoryCB, category ); |
54 | layout->addWidget( m_categoryCB ); | 58 | layout->addWidget( m_categoryCB ); |
55 | layout->addWidget( m_category ); | 59 | layout->addWidget( m_category ); |
56 | 60 | ||
57 | // Package name | 61 | // Package name |
58 | m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); | 62 | m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); |
63 | QWhatsThis::add( m_nameCB, tr( "Tap here to filter package list by package name." ) ); | ||
59 | connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); | 64 | connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); |
60 | m_name = new QLineEdit( name, container ); | 65 | m_name = new QLineEdit( name, container ); |
66 | QWhatsThis::add( m_name, tr( "Enter the package name to filter by here." ) ); | ||
61 | if ( !name.isNull() ) | 67 | if ( !name.isNull() ) |
62 | m_nameCB->setChecked( true ); | 68 | m_nameCB->setChecked( true ); |
63 | m_name->setEnabled( !name.isNull() ); | 69 | m_name->setEnabled( !name.isNull() ); |
64 | layout->addWidget( m_nameCB ); | 70 | layout->addWidget( m_nameCB ); |
65 | layout->addWidget( m_name ); | 71 | layout->addWidget( m_name ); |
66 | 72 | ||
67 | // Status | 73 | // Status |
68 | m_statusCB = new QCheckBox( tr( "With the status:" ), container ); | 74 | m_statusCB = new QCheckBox( tr( "With the status:" ), container ); |
75 | QWhatsThis::add( m_statusCB, tr( "Tap here to filter package list by the package status." ) ); | ||
69 | connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); | 76 | connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); |
70 | m_status = new QComboBox( container ); | 77 | m_status = new QComboBox( container ); |
78 | QWhatsThis::add( m_status, tr( "Select the package status to filter by here." ) ); | ||
71 | connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) ); | 79 | connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) ); |
72 | QString currStatus; | 80 | QString currStatus; |
73 | switch ( status ) | 81 | switch ( status ) |
74 | { | 82 | { |
75 | case OPackageManager::All : currStatus = tr( "All" ); | 83 | case OPackageManager::All : currStatus = tr( "All" ); |
76 | break; | 84 | break; |
77 | case OPackageManager::Installed : currStatus = tr( "Installed" ); | 85 | case OPackageManager::Installed : currStatus = tr( "Installed" ); |
78 | break; | 86 | break; |
79 | case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); | 87 | case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); |
80 | break; | 88 | break; |
81 | case OPackageManager::Updated : currStatus = tr( "Updated" ); | 89 | case OPackageManager::Updated : currStatus = tr( "Updated" ); |
82 | break; | 90 | break; |
83 | default : currStatus = QString::null; | 91 | default : currStatus = QString::null; |
84 | }; | 92 | }; |
85 | m_status->insertItem( tr( "All" ) ); | 93 | m_status->insertItem( tr( "All" ) ); |
86 | m_status->insertItem( tr( "Installed" ) ); | 94 | m_status->insertItem( tr( "Installed" ) ); |
87 | m_status->insertItem( tr( "Not installed" ) ); | 95 | m_status->insertItem( tr( "Not installed" ) ); |
88 | m_status->insertItem( tr( "Updated" ) ); | 96 | m_status->insertItem( tr( "Updated" ) ); |
89 | initItem( m_status, m_statusCB, currStatus ); | 97 | initItem( m_status, m_statusCB, currStatus ); |
90 | layout->addWidget( m_statusCB ); | 98 | layout->addWidget( m_statusCB ); |
91 | layout->addWidget( m_status ); | 99 | layout->addWidget( m_status ); |
92 | 100 | ||
93 | // Server | 101 | // Server |
94 | m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); | 102 | m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); |
103 | QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) ); | ||
95 | connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); | 104 | connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); |
96 | m_server = new QComboBox( container ); | 105 | m_server = new QComboBox( container ); |
106 | QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) ); | ||
97 | m_server->insertStringList( *(pm->servers()) ); | 107 | m_server->insertStringList( *(pm->servers()) ); |
98 | initItem( m_server, m_serverCB, server ); | 108 | initItem( m_server, m_serverCB, server ); |
99 | layout->addWidget( m_serverCB ); | 109 | layout->addWidget( m_serverCB ); |
100 | layout->addWidget( m_server ); | 110 | layout->addWidget( m_server ); |
101 | 111 | ||
102 | // Destination | 112 | // Destination |
103 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); | 113 | m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); |
114 | QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) ); | ||
104 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); | 115 | connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); |
105 | m_destination = new QComboBox( container ); | 116 | m_destination = new QComboBox( container ); |
117 | QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) ); | ||
106 | m_destination->insertStringList( *(pm->destinations()) ); | 118 | m_destination->insertStringList( *(pm->destinations()) ); |
107 | initItem( m_destination, m_destCB, destination ); | 119 | initItem( m_destination, m_destCB, destination ); |
108 | layout->addWidget( m_destCB ); | 120 | layout->addWidget( m_destCB ); |
109 | layout->addWidget( m_destination ); | 121 | layout->addWidget( m_destination ); |
110 | |||
111 | //showMaximized(); | ||
112 | } | 122 | } |
113 | 123 | ||
114 | void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) | 124 | void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) |
115 | { | 125 | { |
116 | if ( !selection.isNull() ) | 126 | if ( !selection.isNull() ) |
117 | { | 127 | { |
118 | checkBox->setChecked( true ); | 128 | checkBox->setChecked( true ); |
119 | 129 | ||
120 | for ( int i = 0; i < comboBox->count(); i++ ) | 130 | for ( int i = 0; i < comboBox->count(); i++ ) |
121 | { | 131 | { |
122 | if ( comboBox->text( i ) == selection ) | 132 | if ( comboBox->text( i ) == selection ) |
123 | { | 133 | { |
124 | comboBox->setCurrentItem( i ); | 134 | comboBox->setCurrentItem( i ); |
125 | return; | 135 | return; |
126 | } | 136 | } |
127 | } | 137 | } |
128 | } | 138 | } |
129 | comboBox->setEnabled( !selection.isNull() ); | 139 | comboBox->setEnabled( !selection.isNull() ); |
130 | } | 140 | } |
131 | 141 | ||
132 | void FilterDlg::slotNameSelected( bool selected ) | 142 | void FilterDlg::slotNameSelected( bool selected ) |
133 | { | 143 | { |
134 | m_name->setEnabled( selected ); | 144 | m_name->setEnabled( selected ); |
135 | } | 145 | } |
136 | 146 | ||
137 | void FilterDlg::slotServerSelected( bool selected ) | 147 | void FilterDlg::slotServerSelected( bool selected ) |
138 | { | 148 | { |
139 | m_server->setEnabled( selected ); | 149 | m_server->setEnabled( selected ); |
140 | } | 150 | } |
141 | 151 | ||
142 | void FilterDlg::slotDestSelected( bool selected ) | 152 | void FilterDlg::slotDestSelected( bool selected ) |
143 | { | 153 | { |
144 | m_destination->setEnabled( selected ); | 154 | m_destination->setEnabled( selected ); |
145 | } | 155 | } |
146 | 156 | ||
147 | void FilterDlg::slotStatusSelected( bool selected ) | 157 | void FilterDlg::slotStatusSelected( bool selected ) |
148 | { | 158 | { |
149 | m_status->setEnabled( selected ); | 159 | m_status->setEnabled( selected ); |
150 | 160 | ||
151 | if ( !selected && !m_destCB->isEnabled() ) | 161 | if ( !selected && !m_destCB->isEnabled() ) |
152 | { | 162 | { |
153 | // If status check box has been deselected and destination option was previously deselected | 163 | // If status check box has been deselected and destination option was previously deselected |
154 | // (because status == "Not installed"), re-enable destination option | 164 | // (because status == "Not installed"), re-enable destination option |
155 | m_destCB->setEnabled( true ); | 165 | m_destCB->setEnabled( true ); |
156 | m_destination->setEnabled( true ); | 166 | m_destination->setEnabled( true ); |
157 | } | 167 | } |
158 | else if ( selected && m_destCB->isEnabled() && m_status->currentText() == tr( "Not installed" ) ) | 168 | else if ( selected && m_destCB->isEnabled() && m_status->currentText() == tr( "Not installed" ) ) |
159 | { | 169 | { |
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index b334bca..810046f 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -71,224 +71,224 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | |||
71 | , m_filterCategory( QString::null ) | 71 | , m_filterCategory( QString::null ) |
72 | 72 | ||
73 | { | 73 | { |
74 | // setCaption( tr( "Package Manager" ) ); | 74 | // setCaption( tr( "Package Manager" ) ); |
75 | 75 | ||
76 | m_iconNull.fill( colorGroup().base() ); | 76 | m_iconNull.fill( colorGroup().base() ); |
77 | 77 | ||
78 | connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); | 78 | connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); |
79 | 79 | ||
80 | // Initialize widget stack, package list and status widget | 80 | // Initialize widget stack, package list and status widget |
81 | initStatusWidget(); | 81 | initStatusWidget(); |
82 | initPackageList(); | 82 | initPackageList(); |
83 | 83 | ||
84 | m_widgetStack.addWidget( &m_statusWidget, 2 ); | 84 | m_widgetStack.addWidget( &m_statusWidget, 2 ); |
85 | m_widgetStack.addWidget( &m_packageList, 1 ); | 85 | m_widgetStack.addWidget( &m_packageList, 1 ); |
86 | setCentralWidget( &m_widgetStack ); | 86 | setCentralWidget( &m_widgetStack ); |
87 | 87 | ||
88 | // Initialize remaining user interface items | 88 | // Initialize remaining user interface items |
89 | initUI(); | 89 | initUI(); |
90 | 90 | ||
91 | // Initialize package information | 91 | // Initialize package information |
92 | QTimer::singleShot( 100, this, SLOT( initPackageInfo() ) ); | 92 | QTimer::singleShot( 100, this, SLOT( initPackageInfo() ) ); |
93 | } | 93 | } |
94 | 94 | ||
95 | void MainWindow::closeEvent( QCloseEvent *event ) | 95 | void MainWindow::closeEvent( QCloseEvent *event ) |
96 | { | 96 | { |
97 | // Close app only if either the package or status widgets are currently active | 97 | // Close app only if either the package or status widgets are currently active |
98 | bool close = m_widgetStack.visibleWidget() == &m_packageList || | 98 | bool close = m_widgetStack.visibleWidget() == &m_packageList || |
99 | m_widgetStack.visibleWidget() == &m_statusWidget; | 99 | m_widgetStack.visibleWidget() == &m_statusWidget; |
100 | if ( close ) | 100 | if ( close ) |
101 | { | 101 | { |
102 | // TODO - write out application configuration settings | 102 | // TODO - write out application configuration settings |
103 | 103 | ||
104 | // Write out package manager configuration settings | 104 | // Write out package manager configuration settings |
105 | m_packman.saveSettings(); | 105 | m_packman.saveSettings(); |
106 | event->accept(); | 106 | event->accept(); |
107 | } | 107 | } |
108 | else | 108 | else |
109 | { | 109 | { |
110 | delete m_widgetStack.visibleWidget(); | 110 | delete m_widgetStack.visibleWidget(); |
111 | m_widgetStack.raiseWidget( &m_packageList ); | 111 | m_widgetStack.raiseWidget( &m_packageList ); |
112 | event->ignore(); | 112 | event->ignore(); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | void MainWindow::initPackageList() | 116 | void MainWindow::initPackageList() |
117 | { | 117 | { |
118 | m_packageList.addColumn( tr( "Packages" ) ); | 118 | m_packageList.addColumn( tr( "Packages" ) ); |
119 | 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\nClick inside the box at the left to select a package." ) ); | 119 | 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." ) ); |
120 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); | 120 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); |
121 | connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), | 121 | connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), |
122 | this, SLOT(slotDisplayPackageInfo(QListViewItem*)) ); | 122 | this, SLOT(slotDisplayPackageInfo(QListViewItem*)) ); |
123 | } | 123 | } |
124 | 124 | ||
125 | void MainWindow::initStatusWidget() | 125 | void MainWindow::initStatusWidget() |
126 | { | 126 | { |
127 | QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); | 127 | QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); |
128 | 128 | ||
129 | m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); | 129 | m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); |
130 | layout->addWidget( &m_statusText ); | 130 | layout->addWidget( &m_statusText ); |
131 | 131 | ||
132 | connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); | 132 | connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); |
133 | connect( &m_packman, SIGNAL(statusText(const QString&)), this, SLOT(slotStatusText(const QString&)) ); | 133 | connect( &m_packman, SIGNAL(statusText(const QString&)), this, SLOT(slotStatusText(const QString&)) ); |
134 | connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); | 134 | connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); |
135 | 135 | ||
136 | layout->addWidget( &m_statusBar ); | 136 | layout->addWidget( &m_statusBar ); |
137 | } | 137 | } |
138 | 138 | ||
139 | void MainWindow::initUI() | 139 | void MainWindow::initUI() |
140 | { | 140 | { |
141 | // Build menu and tool bars | 141 | // Build menu and tool bars |
142 | setToolBarsMovable( false ); | 142 | setToolBarsMovable( false ); |
143 | 143 | ||
144 | m_menuBar.setHorizontalStretchable( true ); | 144 | m_menuBar.setHorizontalStretchable( true ); |
145 | QMenuBar *mb = new QMenuBar( &m_menuBar ); | 145 | QMenuBar *mb = new QMenuBar( &m_menuBar ); |
146 | mb->setMargin( 0 ); | 146 | mb->setMargin( 0 ); |
147 | 147 | ||
148 | // Find toolbar | 148 | // Find toolbar |
149 | addToolBar( &m_findBar, QMainWindow::Top, true ); | 149 | addToolBar( &m_findBar, QMainWindow::Top, true ); |
150 | m_findBar.setHorizontalStretchable( true ); | 150 | m_findBar.setHorizontalStretchable( true ); |
151 | m_findEdit = new QLineEdit( &m_findBar ); | 151 | m_findEdit = new QLineEdit( &m_findBar ); |
152 | QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) ); | 152 | QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) ); |
153 | m_findBar.setStretchableWidget( m_findEdit ); | 153 | m_findBar.setStretchableWidget( m_findEdit ); |
154 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); | 154 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); |
155 | 155 | ||
156 | // Packages menu | 156 | // Packages menu |
157 | QPopupMenu *popup = new QPopupMenu( this ); | 157 | QPopupMenu *popup = new QPopupMenu( this ); |
158 | 158 | ||
159 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); | 159 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); |
160 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 160 | a->setWhatsThis( tr( "Tap here to update package lists from servers." ) ); |
161 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); | 161 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); |
162 | a->addTo( popup ); | 162 | a->addTo( popup ); |
163 | a->addTo( &m_toolBar ); | 163 | a->addTo( &m_toolBar ); |
164 | 164 | ||
165 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); | 165 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); |
166 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); | 166 | actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) ); |
167 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); | 167 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); |
168 | actionUpgrade->addTo( popup ); | 168 | actionUpgrade->addTo( popup ); |
169 | actionUpgrade->addTo( &m_toolBar ); | 169 | actionUpgrade->addTo( &m_toolBar ); |
170 | 170 | ||
171 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); | 171 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); |
172 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); | 172 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); |
173 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 173 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
174 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); | 174 | actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); |
175 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); | 175 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); |
176 | actionDownload->addTo( popup ); | 176 | actionDownload->addTo( popup ); |
177 | actionDownload->addTo( &m_toolBar ); | 177 | actionDownload->addTo( &m_toolBar ); |
178 | 178 | ||
179 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); | 179 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); |
180 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); | 180 | a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); |
181 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); | 181 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); |
182 | a->addTo( popup ); | 182 | a->addTo( popup ); |
183 | a->addTo( &m_toolBar ); | 183 | a->addTo( &m_toolBar ); |
184 | 184 | ||
185 | popup->insertSeparator(); | 185 | popup->insertSeparator(); |
186 | 186 | ||
187 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); | 187 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); |
188 | a->setWhatsThis( tr( "Click here to configure this application." ) ); | 188 | a->setWhatsThis( tr( "Tap here to configure this application." ) ); |
189 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); | 189 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); |
190 | a->addTo( popup ); | 190 | a->addTo( popup ); |
191 | mb->insertItem( tr( "Actions" ), popup ); | 191 | mb->insertItem( tr( "Actions" ), popup ); |
192 | 192 | ||
193 | // View menu | 193 | // View menu |
194 | popup = new QPopupMenu( this ); | 194 | popup = new QPopupMenu( this ); |
195 | 195 | ||
196 | m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 196 | m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
197 | m_actionShowNotInstalled->setToggleAction( true ); | 197 | m_actionShowNotInstalled->setToggleAction( true ); |
198 | m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); | 198 | m_actionShowNotInstalled->setWhatsThis( tr( "Tap here to show packages available which have not been installed." ) ); |
199 | connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); | 199 | connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); |
200 | m_actionShowNotInstalled->addTo( popup ); | 200 | m_actionShowNotInstalled->addTo( popup ); |
201 | 201 | ||
202 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 202 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
203 | m_actionShowInstalled->setToggleAction( true ); | 203 | m_actionShowInstalled->setToggleAction( true ); |
204 | m_actionShowInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); | 204 | m_actionShowInstalled->setWhatsThis( tr( "Tap here to show packages currently installed on this device." ) ); |
205 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); | 205 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); |
206 | m_actionShowInstalled->addTo( popup ); | 206 | m_actionShowInstalled->addTo( popup ); |
207 | 207 | ||
208 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 208 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
209 | m_actionShowUpdated->setToggleAction( true ); | 209 | m_actionShowUpdated->setToggleAction( true ); |
210 | m_actionShowUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); | 210 | m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) ); |
211 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); | 211 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); |
212 | m_actionShowUpdated->addTo( popup ); | 212 | m_actionShowUpdated->addTo( popup ); |
213 | 213 | ||
214 | popup->insertSeparator(); | 214 | popup->insertSeparator(); |
215 | 215 | ||
216 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), | 216 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), |
217 | QString::null, 0, this, 0 ); | 217 | QString::null, 0, this, 0 ); |
218 | m_actionFilter->setToggleAction( true ); | 218 | m_actionFilter->setToggleAction( true ); |
219 | m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) ); | 219 | m_actionFilter->setWhatsThis( tr( "Tap here to apply current filter." ) ); |
220 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); | 220 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); |
221 | m_actionFilter->addTo( popup ); | 221 | m_actionFilter->addTo( popup ); |
222 | 222 | ||
223 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); | 223 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); |
224 | a->setWhatsThis( tr( "Click here to change the package filter criteria." ) ); | 224 | a->setWhatsThis( tr( "Tap here to change the package filter criteria." ) ); |
225 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | 225 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); |
226 | a->addTo( popup ); | 226 | a->addTo( popup ); |
227 | 227 | ||
228 | popup->insertSeparator(); | 228 | popup->insertSeparator(); |
229 | 229 | ||
230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
231 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); | 231 | a->setWhatsThis( tr( "Tap here to search for text in package names." ) ); |
232 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); | 232 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); |
233 | a->addTo( popup ); | 233 | a->addTo( popup ); |
234 | 234 | ||
235 | m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); | 235 | m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); |
236 | m_actionFindNext->setEnabled( false ); | 236 | m_actionFindNext->setEnabled( false ); |
237 | m_actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); | 237 | m_actionFindNext->setWhatsThis( tr( "Tap here to find the next package name containing the text you are searching for." ) ); |
238 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); | 238 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); |
239 | m_actionFindNext->addTo( popup ); | 239 | m_actionFindNext->addTo( popup ); |
240 | m_actionFindNext->addTo( &m_findBar ); | 240 | m_actionFindNext->addTo( &m_findBar ); |
241 | 241 | ||
242 | mb->insertItem( tr( "View" ), popup ); | 242 | mb->insertItem( tr( "View" ), popup ); |
243 | 243 | ||
244 | // Finish find toolbar creation | 244 | // Finish find toolbar creation |
245 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 245 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
246 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | 246 | a->setWhatsThis( tr( "Tap here to hide the find toolbar." ) ); |
247 | connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); | 247 | connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); |
248 | a->addTo( &m_findBar ); | 248 | a->addTo( &m_findBar ); |
249 | m_findBar.hide(); | 249 | m_findBar.hide(); |
250 | } | 250 | } |
251 | 251 | ||
252 | void MainWindow::loadPackageList( OPackageList *packages, bool clearList ) | 252 | void MainWindow::loadPackageList( OPackageList *packages, bool clearList ) |
253 | { | 253 | { |
254 | if ( clearList ) | 254 | if ( clearList ) |
255 | m_packageList.clear(); | 255 | m_packageList.clear(); |
256 | 256 | ||
257 | if ( packages ) | 257 | if ( packages ) |
258 | { | 258 | { |
259 | for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt ) | 259 | for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt ) |
260 | { | 260 | { |
261 | OPackage *package = packageIt.current(); | 261 | OPackage *package = packageIt.current(); |
262 | QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(), | 262 | QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(), |
263 | QCheckListItem::CheckBox ); | 263 | QCheckListItem::CheckBox ); |
264 | m_packageList.insertItem( item ); | 264 | m_packageList.insertItem( item ); |
265 | 265 | ||
266 | // If a different version of package is available, show update available icon | 266 | // If a different version of package is available, show update available icon |
267 | // Otherwise, show installed icon | 267 | // Otherwise, show installed icon |
268 | if ( !package->versionInstalled().isNull() ) | 268 | if ( !package->versionInstalled().isNull() ) |
269 | { | 269 | { |
270 | if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 ) | 270 | if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 ) |
271 | item->setPixmap( 0, m_iconUpdated ); | 271 | item->setPixmap( 0, m_iconUpdated ); |
272 | else | 272 | else |
273 | item->setPixmap( 0, m_iconInstalled ); | 273 | item->setPixmap( 0, m_iconInstalled ); |
274 | } | 274 | } |
275 | else | 275 | else |
276 | item->setPixmap( 0, m_iconNull ); | 276 | item->setPixmap( 0, m_iconNull ); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | void MainWindow::searchForPackage( const QString &text ) | 281 | void MainWindow::searchForPackage( const QString &text ) |
282 | { | 282 | { |
283 | if ( !text.isEmpty() ) | 283 | if ( !text.isEmpty() ) |
284 | { | 284 | { |
285 | // look through package list for text startng at current position | 285 | // look through package list for text startng at current position |
286 | QCheckListItem *start = static_cast<QCheckListItem *>(m_packageList.currentItem()); | 286 | QCheckListItem *start = static_cast<QCheckListItem *>(m_packageList.currentItem()); |
287 | if ( start == 0 ) | 287 | if ( start == 0 ) |
288 | start = static_cast<QCheckListItem *>(m_packageList.firstChild()); | 288 | start = static_cast<QCheckListItem *>(m_packageList.firstChild()); |
289 | 289 | ||
290 | // for ( QCheckListItem *item = static_cast<QCheckListItem *>(start->nextSibling()); item != 0 ; | 290 | // for ( QCheckListItem *item = static_cast<QCheckListItem *>(start->nextSibling()); item != 0 ; |
291 | for ( QCheckListItem *item = static_cast<QCheckListItem *>(start); item != 0 ; | 291 | for ( QCheckListItem *item = static_cast<QCheckListItem *>(start); item != 0 ; |
292 | item = static_cast<QCheckListItem *>(item->nextSibling()) ) | 292 | item = static_cast<QCheckListItem *>(item->nextSibling()) ) |
293 | { | 293 | { |
294 | if ( item->text().lower().find( text ) != -1 ) | 294 | if ( item->text().lower().find( text ) != -1 ) |
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 74e7137..d134651 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp | |||
@@ -1,95 +1,96 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "oipkgconfigdlg.h" | 32 | #include "oipkgconfigdlg.h" |
33 | 33 | ||
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | #include <qcombobox.h> | 35 | #include <qcombobox.h> |
36 | #include <qgroupbox.h> | 36 | #include <qgroupbox.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qlineedit.h> | 38 | #include <qlineedit.h> |
39 | #include <qlistbox.h> | 39 | #include <qlistbox.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qscrollview.h> | 41 | #include <qscrollview.h> |
42 | #include <qwhatsthis.h> | ||
42 | 43 | ||
43 | #include <qpe/resource.h> | 44 | #include <qpe/resource.h> |
44 | 45 | ||
45 | using namespace Opie::Ui; | 46 | using namespace Opie::Ui; |
46 | OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) | 47 | OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) |
47 | : QDialog( parent, QString::null, true ) | 48 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) |
48 | , m_ipkg( ipkg ) | 49 | , m_ipkg( ipkg ) |
49 | , m_configs( 0x0 ) | 50 | , m_configs( 0x0 ) |
50 | , m_installOptions( installOptions ) | 51 | , m_installOptions( installOptions ) |
51 | , m_serverNew( false ) | 52 | , m_serverNew( false ) |
52 | , m_serverCurrent( -1 ) | 53 | , m_serverCurrent( -1 ) |
53 | , m_destNew( false ) | 54 | , m_destNew( false ) |
54 | , m_destCurrent( -1 ) | 55 | , m_destCurrent( -1 ) |
55 | , m_layout( this, 2, 4 ) | 56 | , m_layout( this, 2, 4 ) |
56 | , m_tabWidget( this ) | 57 | , m_tabWidget( this ) |
57 | { | 58 | { |
58 | setCaption( tr( "Configuration" ) ); | 59 | setCaption( tr( "Configuration" ) ); |
59 | 60 | ||
60 | // Initialize configuration widgets | 61 | // Initialize configuration widgets |
61 | if ( !installOptions ) | 62 | if ( !installOptions ) |
62 | { | 63 | { |
63 | initServerWidget(); | 64 | initServerWidget(); |
64 | initDestinationWidget(); | 65 | initDestinationWidget(); |
65 | initProxyWidget(); | 66 | initProxyWidget(); |
66 | } | 67 | } |
67 | initOptionsWidget(); | 68 | initOptionsWidget(); |
68 | 69 | ||
69 | // Load configuration information | 70 | // Load configuration information |
70 | initData(); | 71 | initData(); |
71 | 72 | ||
72 | // Setup tabs for all info | 73 | // Setup tabs for all info |
73 | m_layout.addWidget( &m_tabWidget ); | 74 | m_layout.addWidget( &m_tabWidget ); |
74 | if ( !m_installOptions ) | 75 | if ( !m_installOptions ) |
75 | { | 76 | { |
76 | m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); | 77 | m_tabWidget.addTab( m_serverWidget, "packagemanager/servertab", tr( "Servers" ) ); |
77 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); | 78 | m_tabWidget.addTab( m_destWidget, "packagemanager/desttab", tr( "Destinations" ) ); |
78 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); | 79 | m_tabWidget.addTab( m_proxyWidget, "packagemanager/proxytab", tr( "Proxies" ) ); |
79 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 80 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
80 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); | 81 | m_tabWidget.setCurrentTab( tr( "Servers" ) ); |
81 | } | 82 | } |
82 | else | 83 | else |
83 | { | 84 | { |
84 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 85 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
85 | } | 86 | } |
86 | 87 | ||
87 | //showMaximized(); | 88 | //showMaximized(); |
88 | } | 89 | } |
89 | 90 | ||
90 | void OIpkgConfigDlg::accept() | 91 | void OIpkgConfigDlg::accept() |
91 | { | 92 | { |
92 | // Save server, destination and proxy configuration | 93 | // Save server, destination and proxy configuration |
93 | if ( !m_installOptions ) | 94 | if ( !m_installOptions ) |
94 | { | 95 | { |
95 | // Update proxy information before saving settings | 96 | // Update proxy information before saving settings |
@@ -122,263 +123,295 @@ void OIpkgConfigDlg::accept() | |||
122 | 123 | ||
123 | confItem = findConfItem( OConfItem::Option, "proxy_password" ); | 124 | confItem = findConfItem( OConfItem::Option, "proxy_password" ); |
124 | if ( confItem ) | 125 | if ( confItem ) |
125 | confItem->setValue( m_proxyPassword->text() ); | 126 | confItem->setValue( m_proxyPassword->text() ); |
126 | else | 127 | else |
127 | m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_password", | 128 | m_configs->append( new OConfItem( QString::null, OConfItem::Option, "proxy_password", |
128 | m_proxyPassword->text() ) ); | 129 | m_proxyPassword->text() ) ); |
129 | 130 | ||
130 | m_ipkg->setConfigItems( m_configs ); | 131 | m_ipkg->setConfigItems( m_configs ); |
131 | } | 132 | } |
132 | 133 | ||
133 | // Save options configuration | 134 | // Save options configuration |
134 | int options = 0; | 135 | int options = 0; |
135 | if ( m_optForceDepends->isChecked() ) | 136 | if ( m_optForceDepends->isChecked() ) |
136 | options |= FORCE_DEPENDS; | 137 | options |= FORCE_DEPENDS; |
137 | if ( m_optForceReinstall->isChecked() ) | 138 | if ( m_optForceReinstall->isChecked() ) |
138 | options |= FORCE_REINSTALL; | 139 | options |= FORCE_REINSTALL; |
139 | if ( m_optForceRemove->isChecked() ) | 140 | if ( m_optForceRemove->isChecked() ) |
140 | options |= FORCE_REMOVE; | 141 | options |= FORCE_REMOVE; |
141 | if ( m_optForceOverwrite->isChecked() ) | 142 | if ( m_optForceOverwrite->isChecked() ) |
142 | options |= FORCE_OVERWRITE; | 143 | options |= FORCE_OVERWRITE; |
143 | m_ipkg->setIpkgExecOptions( options ); | 144 | m_ipkg->setIpkgExecOptions( options ); |
144 | m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); | 145 | m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() ); |
145 | 146 | ||
146 | QDialog::accept(); | 147 | QDialog::accept(); |
147 | } | 148 | } |
148 | 149 | ||
149 | void OIpkgConfigDlg::reject() | 150 | void OIpkgConfigDlg::reject() |
150 | { | 151 | { |
151 | if ( m_configs ) | 152 | if ( m_configs ) |
152 | delete m_configs; | 153 | delete m_configs; |
153 | } | 154 | } |
154 | 155 | ||
155 | void OIpkgConfigDlg::initServerWidget() | 156 | void OIpkgConfigDlg::initServerWidget() |
156 | { | 157 | { |
157 | m_serverWidget = new QWidget( this ); | 158 | m_serverWidget = new QWidget( this ); |
158 | 159 | ||
159 | // Initialize UI | 160 | // Initialize UI |
160 | QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); | 161 | QVBoxLayout *vb = new QVBoxLayout( m_serverWidget ); |
161 | QScrollView *sv = new QScrollView( m_serverWidget ); | 162 | QScrollView *sv = new QScrollView( m_serverWidget ); |
162 | vb->addWidget( sv, 0, 0 ); | 163 | vb->addWidget( sv, 0, 0 ); |
163 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 164 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
164 | sv->setFrameStyle( QFrame::NoFrame ); | 165 | sv->setFrameStyle( QFrame::NoFrame ); |
165 | QWidget *container = new QWidget( sv->viewport() ); | 166 | QWidget *container = new QWidget( sv->viewport() ); |
166 | sv->addChild( container ); | 167 | sv->addChild( container ); |
167 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); | 168 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); |
168 | 169 | ||
169 | m_serverList = new QListBox( container ); | 170 | m_serverList = new QListBox( container ); |
171 | QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) ); | ||
170 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 172 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
171 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) ); | 173 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) ); |
172 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 ); | 174 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 ); |
173 | 175 | ||
174 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 176 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
177 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | ||
175 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); | 178 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); |
176 | layout->addWidget( btn, 1, 0 ); | 179 | layout->addWidget( btn, 1, 0 ); |
177 | 180 | ||
178 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 181 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
182 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); | ||
179 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); | 183 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); |
180 | layout->addWidget( btn, 1, 1 ); | 184 | layout->addWidget( btn, 1, 1 ); |
181 | 185 | ||
182 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 186 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
183 | grpbox->layout()->setSpacing( 2 ); | 187 | grpbox->layout()->setSpacing( 2 ); |
184 | grpbox->layout()->setMargin( 4 ); | 188 | grpbox->layout()->setMargin( 4 ); |
185 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 189 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
186 | 190 | ||
187 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 191 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
188 | 192 | ||
189 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 193 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
194 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | ||
190 | grplayout->addWidget( label, 0, 0 ); | 195 | grplayout->addWidget( label, 0, 0 ); |
191 | m_serverName = new QLineEdit( grpbox ); | 196 | m_serverName = new QLineEdit( grpbox ); |
197 | QWhatsThis::add( m_serverName, tr( "Enter the name of this entry here." ) ); | ||
192 | grplayout->addWidget( m_serverName, 0, 1 ); | 198 | grplayout->addWidget( m_serverName, 0, 1 ); |
193 | 199 | ||
194 | label = new QLabel( tr( "Address:" ), grpbox ); | 200 | label = new QLabel( tr( "Address:" ), grpbox ); |
201 | QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) ); | ||
195 | grplayout->addWidget( label, 1, 0 ); | 202 | grplayout->addWidget( label, 1, 0 ); |
196 | m_serverLocation = new QLineEdit( grpbox ); | 203 | m_serverLocation = new QLineEdit( grpbox ); |
204 | QWhatsThis::add( m_serverLocation, tr( "Enter the URL address of this entry here." ) ); | ||
197 | grplayout->addWidget( m_serverLocation, 1, 1 ); | 205 | grplayout->addWidget( m_serverLocation, 1, 1 ); |
198 | 206 | ||
199 | m_serverActive = new QCheckBox( tr( "Active Server" ), grpbox ); | 207 | m_serverActive = new QCheckBox( tr( "Active" ), grpbox ); |
208 | QWhatsThis::add( m_serverActive, tr( "Tap here to indicate whether this entry is active or not." ) ); | ||
200 | grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 ); | 209 | grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 ); |
201 | 210 | ||
202 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 211 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
212 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); | ||
203 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) ); | 213 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) ); |
204 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 214 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
205 | } | 215 | } |
206 | 216 | ||
207 | void OIpkgConfigDlg::initDestinationWidget() | 217 | void OIpkgConfigDlg::initDestinationWidget() |
208 | { | 218 | { |
209 | m_destWidget = new QWidget( this ); | 219 | m_destWidget = new QWidget( this ); |
210 | 220 | ||
211 | // Initialize UI | 221 | // Initialize UI |
212 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); | 222 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); |
213 | QScrollView *sv = new QScrollView( m_destWidget ); | 223 | QScrollView *sv = new QScrollView( m_destWidget ); |
214 | vb->addWidget( sv, 0, 0 ); | 224 | vb->addWidget( sv, 0, 0 ); |
215 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 225 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
216 | sv->setFrameStyle( QFrame::NoFrame ); | 226 | sv->setFrameStyle( QFrame::NoFrame ); |
217 | QWidget *container = new QWidget( sv->viewport() ); | 227 | QWidget *container = new QWidget( sv->viewport() ); |
218 | sv->addChild( container ); | 228 | sv->addChild( container ); |
219 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); | 229 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); |
220 | 230 | ||
221 | m_destList = new QListBox( container ); | 231 | m_destList = new QListBox( container ); |
232 | QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) ); | ||
222 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 233 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
223 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) ); | 234 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) ); |
224 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 ); | 235 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 ); |
225 | 236 | ||
226 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 237 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
238 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | ||
227 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); | 239 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); |
228 | layout->addWidget( btn, 1, 0 ); | 240 | layout->addWidget( btn, 1, 0 ); |
229 | 241 | ||
230 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 242 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
243 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); | ||
231 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); | 244 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); |
232 | layout->addWidget( btn, 1, 1 ); | 245 | layout->addWidget( btn, 1, 1 ); |
233 | 246 | ||
234 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 247 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
235 | grpbox->layout()->setSpacing( 2 ); | 248 | grpbox->layout()->setSpacing( 2 ); |
236 | grpbox->layout()->setMargin( 4 ); | 249 | grpbox->layout()->setMargin( 4 ); |
237 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 250 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
238 | 251 | ||
239 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 252 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
240 | 253 | ||
241 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 254 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
255 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | ||
242 | grplayout->addWidget( label, 0, 0 ); | 256 | grplayout->addWidget( label, 0, 0 ); |
243 | m_destName = new QLineEdit( grpbox ); | 257 | m_destName = new QLineEdit( grpbox ); |
258 | QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); | ||
244 | grplayout->addWidget( m_destName, 0, 1 ); | 259 | grplayout->addWidget( m_destName, 0, 1 ); |
245 | 260 | ||
246 | label = new QLabel( tr( "Address:" ), grpbox ); | 261 | label = new QLabel( tr( "Location:" ), grpbox ); |
262 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); | ||
247 | grplayout->addWidget( label, 1, 0 ); | 263 | grplayout->addWidget( label, 1, 0 ); |
248 | m_destLocation = new QLineEdit( grpbox ); | 264 | m_destLocation = new QLineEdit( grpbox ); |
265 | QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); | ||
249 | grplayout->addWidget( m_destLocation, 1, 1 ); | 266 | grplayout->addWidget( m_destLocation, 1, 1 ); |
250 | 267 | ||
251 | m_destActive = new QCheckBox( tr( "Active Server" ), grpbox ); | 268 | m_destActive = new QCheckBox( tr( "Active" ), grpbox ); |
269 | QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); | ||
252 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 ); | 270 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 ); |
253 | 271 | ||
254 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 272 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
273 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); | ||
255 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); | 274 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); |
256 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 275 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
257 | } | 276 | } |
258 | 277 | ||
259 | void OIpkgConfigDlg::initProxyWidget() | 278 | void OIpkgConfigDlg::initProxyWidget() |
260 | { | 279 | { |
261 | m_proxyWidget = new QWidget( this ); | 280 | m_proxyWidget = new QWidget( this ); |
262 | 281 | ||
263 | // Initialize UI | 282 | // Initialize UI |
264 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); | 283 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); |
265 | QScrollView *sv = new QScrollView( m_proxyWidget ); | 284 | QScrollView *sv = new QScrollView( m_proxyWidget ); |
266 | vb->addWidget( sv, 0, 0 ); | 285 | vb->addWidget( sv, 0, 0 ); |
267 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 286 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
268 | sv->setFrameStyle( QFrame::NoFrame ); | 287 | sv->setFrameStyle( QFrame::NoFrame ); |
269 | QWidget *container = new QWidget( sv->viewport() ); | 288 | QWidget *container = new QWidget( sv->viewport() ); |
270 | sv->addChild( container ); | 289 | sv->addChild( container ); |
271 | QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); | 290 | QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); |
272 | 291 | ||
273 | // HTTP proxy server configuration | 292 | // HTTP proxy server configuration |
274 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); | 293 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); |
275 | grpbox->layout()->setSpacing( 2 ); | 294 | grpbox->layout()->setSpacing( 2 ); |
276 | grpbox->layout()->setMargin( 4 ); | 295 | grpbox->layout()->setMargin( 4 ); |
277 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); | 296 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); |
278 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); | 297 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); |
279 | m_proxyHttpServer = new QLineEdit( grpbox ); | 298 | m_proxyHttpServer = new QLineEdit( grpbox ); |
299 | QWhatsThis::add( m_proxyHttpServer, tr( "Enter the URL address of the HTTP proxy server here." ) ); | ||
280 | grplayout->addWidget( m_proxyHttpServer ); | 300 | grplayout->addWidget( m_proxyHttpServer ); |
281 | m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); | 301 | m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); |
302 | QWhatsThis::add( m_proxyHttpActive, tr( "Tap here to enable or disable the HTTP proxy server." ) ); | ||
282 | grplayout->addWidget( m_proxyHttpActive ); | 303 | grplayout->addWidget( m_proxyHttpActive ); |
283 | 304 | ||
284 | // FTP proxy server configuration | 305 | // FTP proxy server configuration |
285 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); | 306 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); |
286 | grpbox->layout()->setSpacing( 2 ); | 307 | grpbox->layout()->setSpacing( 2 ); |
287 | grpbox->layout()->setMargin( 4 ); | 308 | grpbox->layout()->setMargin( 4 ); |
288 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); | 309 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); |
289 | grplayout = new QVBoxLayout( grpbox->layout() ); | 310 | grplayout = new QVBoxLayout( grpbox->layout() ); |
290 | m_proxyFtpServer = new QLineEdit( grpbox ); | 311 | m_proxyFtpServer = new QLineEdit( grpbox ); |
312 | QWhatsThis::add( m_proxyFtpServer, tr( "Enter the URL address of the FTP proxy server here." ) ); | ||
291 | grplayout->addWidget( m_proxyFtpServer ); | 313 | grplayout->addWidget( m_proxyFtpServer ); |
292 | m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); | 314 | m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); |
315 | QWhatsThis::add( m_proxyFtpActive, tr( "Tap here to enable or disable the FTP proxy server." ) ); | ||
293 | grplayout->addWidget( m_proxyFtpActive ); | 316 | grplayout->addWidget( m_proxyFtpActive ); |
294 | 317 | ||
295 | // Proxy server username and password configuration | 318 | // Proxy server username and password configuration |
296 | QLabel *label = new QLabel( tr( "Username:" ), container ); | 319 | QLabel *label = new QLabel( tr( "Username:" ), container ); |
320 | QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); | ||
297 | layout->addWidget( label, 2, 0 ); | 321 | layout->addWidget( label, 2, 0 ); |
298 | m_proxyUsername = new QLineEdit( container ); | 322 | m_proxyUsername = new QLineEdit( container ); |
323 | QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); | ||
299 | layout->addWidget( m_proxyUsername, 2, 1 ); | 324 | layout->addWidget( m_proxyUsername, 2, 1 ); |
300 | 325 | ||
301 | label = new QLabel( tr( "Password:" ), container ); | 326 | label = new QLabel( tr( "Password:" ), container ); |
327 | QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); | ||
302 | layout->addWidget( label, 3, 0 ); | 328 | layout->addWidget( label, 3, 0 ); |
303 | m_proxyPassword = new QLineEdit( container ); | 329 | m_proxyPassword = new QLineEdit( container ); |
330 | QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); | ||
304 | layout->addWidget( m_proxyPassword, 3, 1 ); | 331 | layout->addWidget( m_proxyPassword, 3, 1 ); |
305 | } | 332 | } |
306 | 333 | ||
307 | void OIpkgConfigDlg::initOptionsWidget() | 334 | void OIpkgConfigDlg::initOptionsWidget() |
308 | { | 335 | { |
309 | m_optionsWidget = new QWidget( this ); | 336 | m_optionsWidget = new QWidget( this ); |
310 | 337 | ||
311 | // Initialize UI | 338 | // Initialize UI |
312 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); | 339 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); |
313 | QScrollView *sv = new QScrollView( m_optionsWidget ); | 340 | QScrollView *sv = new QScrollView( m_optionsWidget ); |
314 | vb->addWidget( sv, 0, 0 ); | 341 | vb->addWidget( sv, 0, 0 ); |
315 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 342 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
316 | sv->setFrameStyle( QFrame::NoFrame ); | 343 | sv->setFrameStyle( QFrame::NoFrame ); |
317 | QWidget *container = new QWidget( sv->viewport() ); | 344 | QWidget *container = new QWidget( sv->viewport() ); |
318 | sv->addChild( container ); | 345 | sv->addChild( container ); |
319 | QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); | 346 | QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); |
320 | 347 | ||
321 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); | 348 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); |
349 | QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); | ||
322 | layout->addWidget( m_optForceDepends ); | 350 | layout->addWidget( m_optForceDepends ); |
323 | 351 | ||
324 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); | 352 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); |
353 | QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); | ||
325 | layout->addWidget( m_optForceReinstall ); | 354 | layout->addWidget( m_optForceReinstall ); |
326 | 355 | ||
327 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); | 356 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); |
357 | QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); | ||
328 | layout->addWidget( m_optForceRemove ); | 358 | layout->addWidget( m_optForceRemove ); |
329 | 359 | ||
330 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); | 360 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); |
361 | QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); | ||
331 | layout->addWidget( m_optForceOverwrite ); | 362 | layout->addWidget( m_optForceOverwrite ); |
332 | 363 | ||
333 | QLabel *l = new QLabel( tr( "Information Level" ), container ); | 364 | QLabel *l = new QLabel( tr( "Information Level" ), container ); |
365 | QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); | ||
334 | layout->addWidget( l ); | 366 | layout->addWidget( l ); |
335 | 367 | ||
336 | m_optVerboseIpkg = new QComboBox( container ); | 368 | m_optVerboseIpkg = new QComboBox( container ); |
369 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); | ||
337 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); | 370 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); |
338 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); | 371 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); |
339 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); | 372 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); |
340 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); | 373 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); |
341 | layout->addWidget( m_optVerboseIpkg ); | 374 | layout->addWidget( m_optVerboseIpkg ); |
342 | 375 | ||
343 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 376 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
344 | } | 377 | } |
345 | 378 | ||
346 | void OIpkgConfigDlg::initData() | 379 | void OIpkgConfigDlg::initData() |
347 | { | 380 | { |
348 | // Read ipkg configuration (server/destination/proxy) information | 381 | // Read ipkg configuration (server/destination/proxy) information |
349 | if ( m_ipkg && !m_installOptions ) | 382 | if ( m_ipkg && !m_installOptions ) |
350 | { | 383 | { |
351 | m_configs = m_ipkg->configItems(); | 384 | m_configs = m_ipkg->configItems(); |
352 | if ( m_configs ) | 385 | if ( m_configs ) |
353 | { | 386 | { |
354 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) | 387 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) |
355 | { | 388 | { |
356 | OConfItem *config = configIt.current(); | 389 | OConfItem *config = configIt.current(); |
357 | 390 | ||
358 | // Add configuration item to the appropriate dialog controls | 391 | // Add configuration item to the appropriate dialog controls |
359 | if ( config ) | 392 | if ( config ) |
360 | { | 393 | { |
361 | if ( config->type() == OConfItem::Source ) | 394 | if ( config->type() == OConfItem::Source ) |
362 | { | 395 | { |
363 | m_serverList->insertItem( config->name() ); | 396 | m_serverList->insertItem( config->name() ); |
364 | } | 397 | } |
365 | else if ( config->type() == OConfItem::Destination ) | 398 | else if ( config->type() == OConfItem::Destination ) |
366 | { | 399 | { |
367 | m_destList->insertItem( config->name() ); | 400 | m_destList->insertItem( config->name() ); |
368 | } | 401 | } |
369 | else if ( config->type() == OConfItem::Option ) | 402 | else if ( config->type() == OConfItem::Option ) |
370 | { | 403 | { |
371 | if ( config->name() == "http_proxy" ) | 404 | if ( config->name() == "http_proxy" ) |
372 | { | 405 | { |
373 | m_proxyHttpServer->setText( config->value() ); | 406 | m_proxyHttpServer->setText( config->value() ); |
374 | m_proxyHttpActive->setChecked( config->active() ); | 407 | m_proxyHttpActive->setChecked( config->active() ); |
375 | } | 408 | } |
376 | else if ( config->name() == "ftp_proxy" ) | 409 | else if ( config->name() == "ftp_proxy" ) |
377 | { | 410 | { |
378 | m_proxyFtpServer->setText( config->value() ); | 411 | m_proxyFtpServer->setText( config->value() ); |
379 | m_proxyFtpActive->setChecked( config->active() ); | 412 | m_proxyFtpActive->setChecked( config->active() ); |
380 | } | 413 | } |
381 | else if ( config->name() == "proxy_username" ) | 414 | else if ( config->name() == "proxy_username" ) |
382 | { | 415 | { |
383 | m_proxyUsername->setText( config->value() ); | 416 | m_proxyUsername->setText( config->value() ); |
384 | } | 417 | } |