author | drw <drw> | 2005-06-05 22:41:15 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-05 22:41:15 (UTC) |
commit | 56b8917e2cca3715e9a19941965ddd73e6bba5d4 (patch) (unidiff) | |
tree | 77f19a696d1cc4568083f38467390b59c5270da2 /noncore/settings/packagemanager/oipkgconfigdlg.cpp | |
parent | 31e8d6aad8220f747113870cfa10261435a2a162 (diff) | |
download | opie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.zip opie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.tar.gz opie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.tar.bz2 |
Resource -> OResource
Diffstat (limited to 'noncore/settings/packagemanager/oipkgconfigdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 945571f..58c572b 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp | |||
@@ -22,27 +22,27 @@ | |||
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 | #include "oipkgconfigdlg.h" | 31 | #include "oipkgconfigdlg.h" |
32 | 32 | ||
33 | #include <opie2/ofiledialog.h> | 33 | #include <opie2/ofiledialog.h> |
34 | #include <opie2/oresource.h> | ||
34 | 35 | ||
35 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
36 | #include <qpe/resource.h> | ||
37 | 37 | ||
38 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qgroupbox.h> | 40 | #include <qgroupbox.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlineedit.h> | 42 | #include <qlineedit.h> |
43 | #include <qlistbox.h> | 43 | #include <qlistbox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qscrollview.h> | 45 | #include <qscrollview.h> |
46 | #include <qwhatsthis.h> | 46 | #include <qwhatsthis.h> |
47 | 47 | ||
48 | OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) | 48 | OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) |
@@ -173,43 +173,42 @@ void OIpkgConfigDlg::initServerWidget() | |||
173 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 173 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
174 | sv->setFrameStyle( QFrame::NoFrame ); | 174 | sv->setFrameStyle( QFrame::NoFrame ); |
175 | QWidget *container = new QWidget( sv->viewport() ); | 175 | QWidget *container = new QWidget( sv->viewport() ); |
176 | sv->addChild( container ); | 176 | sv->addChild( container ); |
177 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); | 177 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); |
178 | 178 | ||
179 | m_serverList = new QListBox( container ); | 179 | m_serverList = new QListBox( container ); |
180 | 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." ) ); | 180 | 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." ) ); |
181 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 181 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
182 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); | 182 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); |
183 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); | 183 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); |
184 | 184 | ||
185 | QPixmap pic; | 185 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
186 | pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 186 | tr( "New" ), container ); |
187 | QPushButton *btn = new QPushButton( pic, tr( "New" ), container ); | 187 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
188 | btn->setMinimumHeight( AppLnk::smallIconSize() ); | ||
189 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | 188 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); |
190 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); | 189 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); |
191 | layout->addWidget( btn, 1, 0 ); | 190 | layout->addWidget( btn, 1, 0 ); |
192 | 191 | ||
193 | pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 192 | m_serverEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), |
194 | m_serverEditBtn = new QPushButton( pic, tr( "Edit" ), container ); | 193 | tr( "Edit" ), container ); |
195 | m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize() ); | 194 | m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
196 | m_serverEditBtn->setEnabled( false ); | 195 | m_serverEditBtn->setEnabled( false ); |
197 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); | 196 | QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); |
198 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); | 197 | connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); |
199 | layout->addWidget( m_serverEditBtn, 1, 1 ); | 198 | layout->addWidget( m_serverEditBtn, 1, 1 ); |
200 | 199 | ||
201 | pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 200 | m_serverDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), |
202 | m_serverDeleteBtn = new QPushButton( pic, tr( "Delete" ), container ); | 201 | tr( "Delete" ), container ); |
203 | m_serverDeleteBtn->setMinimumHeight( AppLnk::smallIconSize() ); | 202 | m_serverDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
204 | m_serverDeleteBtn->setEnabled( false ); | 203 | m_serverDeleteBtn->setEnabled( false ); |
205 | QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); | 204 | QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); |
206 | connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); | 205 | connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); |
207 | layout->addWidget( m_serverDeleteBtn, 1, 2 ); | 206 | layout->addWidget( m_serverDeleteBtn, 1, 2 ); |
208 | } | 207 | } |
209 | 208 | ||
210 | void OIpkgConfigDlg::initDestinationWidget() | 209 | void OIpkgConfigDlg::initDestinationWidget() |
211 | { | 210 | { |
212 | m_destWidget = new QWidget( this ); | 211 | m_destWidget = new QWidget( this ); |
213 | 212 | ||
214 | // Initialize UI | 213 | // Initialize UI |
215 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); | 214 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); |
@@ -218,43 +217,42 @@ void OIpkgConfigDlg::initDestinationWidget() | |||
218 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 217 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
219 | sv->setFrameStyle( QFrame::NoFrame ); | 218 | sv->setFrameStyle( QFrame::NoFrame ); |
220 | QWidget *container = new QWidget( sv->viewport() ); | 219 | QWidget *container = new QWidget( sv->viewport() ); |
221 | sv->addChild( container ); | 220 | sv->addChild( container ); |
222 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); | 221 | QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 ); |
223 | 222 | ||
224 | m_destList = new QListBox( container ); | 223 | m_destList = new QListBox( container ); |
225 | 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." ) ); | 224 | 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." ) ); |
226 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 225 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
227 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) ); | 226 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) ); |
228 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 ); | 227 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 ); |
229 | 228 | ||
230 | QPixmap pic; | 229 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
231 | pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 230 | tr( "New" ), container ); |
232 | QPushButton *btn = new QPushButton( pic, tr( "New" ), container ); | 231 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
233 | btn->setMinimumHeight( AppLnk::smallIconSize() ); | ||
234 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | 232 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); |
235 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); | 233 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); |
236 | layout->addWidget( btn, 1, 0 ); | 234 | layout->addWidget( btn, 1, 0 ); |
237 | 235 | ||
238 | pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 236 | m_destEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), |
239 | m_destEditBtn = new QPushButton( pic, tr( "Edit" ), container ); | 237 | tr( "Edit" ), container ); |
240 | m_destEditBtn->setMinimumHeight( AppLnk::smallIconSize() ); | 238 | m_destEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
241 | m_destEditBtn->setEnabled( false ); | 239 | m_destEditBtn->setEnabled( false ); |
242 | QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); | 240 | QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); |
243 | connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); | 241 | connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); |
244 | layout->addWidget( m_destEditBtn, 1, 1 ); | 242 | layout->addWidget( m_destEditBtn, 1, 1 ); |
245 | 243 | ||
246 | pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 244 | m_destDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), |
247 | m_destDeleteBtn = new QPushButton( pic, tr( "Delete" ), container ); | 245 | tr( "Delete" ), container ); |
248 | m_destDeleteBtn->setMinimumHeight( AppLnk::smallIconSize() ); | 246 | m_destDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); |
249 | m_destDeleteBtn->setEnabled( false ); | 247 | m_destDeleteBtn->setEnabled( false ); |
250 | QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); | 248 | QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); |
251 | connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); | 249 | connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); |
252 | layout->addWidget( m_destDeleteBtn, 1, 2 ); | 250 | layout->addWidget( m_destDeleteBtn, 1, 2 ); |
253 | } | 251 | } |
254 | 252 | ||
255 | void OIpkgConfigDlg::initProxyWidget() | 253 | void OIpkgConfigDlg::initProxyWidget() |
256 | { | 254 | { |
257 | m_proxyWidget = new QWidget( this ); | 255 | m_proxyWidget = new QWidget( this ); |
258 | 256 | ||
259 | // Initialize UI | 257 | // Initialize UI |
260 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); | 258 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); |
@@ -348,27 +346,28 @@ void OIpkgConfigDlg::initOptionsWidget() | |||
348 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); | 346 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); |
349 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); | 347 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); |
350 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); | 348 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); |
351 | layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 ); | 349 | layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 ); |
352 | 350 | ||
353 | l = new QLabel( tr( "Package source lists directory:" ), container ); | 351 | l = new QLabel( tr( "Package source lists directory:" ), container ); |
354 | QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); | 352 | QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); |
355 | layout->addMultiCellWidget( l, 6, 6, 0, 1 ); | 353 | layout->addMultiCellWidget( l, 6, 6, 0, 1 ); |
356 | 354 | ||
357 | m_optSourceLists = new QLineEdit( container ); | 355 | m_optSourceLists = new QLineEdit( container ); |
358 | QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); | 356 | QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); |
359 | layout->addWidget( m_optSourceLists, 7, 0 ); | 357 | layout->addWidget( m_optSourceLists, 7, 0 ); |
360 | QPixmap pic; | 358 | |
361 | pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 359 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ), |
362 | QPushButton *btn = new QPushButton( pic, QString::null, container ); | 360 | QString::null, container ); |
361 | btn->setMinimumHeight( AppLnk::smallIconSize()+4 ); | ||
363 | btn->setMaximumWidth( btn->height() ); | 362 | btn->setMaximumWidth( btn->height() ); |
364 | QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); | 363 | QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); |
365 | connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); | 364 | connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); |
366 | layout->addWidget( btn, 7, 1 ); | 365 | layout->addWidget( btn, 7, 1 ); |
367 | 366 | ||
368 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 367 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
369 | } | 368 | } |
370 | 369 | ||
371 | void OIpkgConfigDlg::initData() | 370 | void OIpkgConfigDlg::initData() |
372 | { | 371 | { |
373 | // Read ipkg configuration (server/destination/proxy) information | 372 | // Read ipkg configuration (server/destination/proxy) information |
374 | if ( m_ipkg && !m_installOptions ) | 373 | if ( m_ipkg && !m_installOptions ) |
@@ -653,27 +652,26 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent ) | |||
653 | layout->addStretch(); | 652 | layout->addStretch(); |
654 | 653 | ||
655 | label = new QLabel( tr( "Location:" ), this ); | 654 | label = new QLabel( tr( "Location:" ), this ); |
656 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); | 655 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); |
657 | layout->addWidget( label ); | 656 | layout->addWidget( label ); |
658 | 657 | ||
659 | QHBoxLayout *layout2 = new QHBoxLayout( this, 2, 4 ); | 658 | QHBoxLayout *layout2 = new QHBoxLayout( this, 2, 4 ); |
660 | layout->addLayout( layout2 ); | 659 | layout->addLayout( layout2 ); |
661 | 660 | ||
662 | m_location = new QLineEdit( this ); | 661 | m_location = new QLineEdit( this ); |
663 | QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) ); | 662 | QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) ); |
664 | layout2->addWidget( m_location ); | 663 | layout2->addWidget( m_location ); |
665 | QPixmap pic; | 664 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ), |
666 | pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 665 | QString::null, this ); |
667 | QPushButton *btn = new QPushButton( pic, QString::null, this ); | ||
668 | btn->setMaximumWidth( btn->height() ); | 666 | btn->setMaximumWidth( btn->height() ); |
669 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); | 667 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); |
670 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); | 668 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); |
671 | layout2->addWidget( btn ); | 669 | layout2->addWidget( btn ); |
672 | 670 | ||
673 | // Populate initial information | 671 | // Populate initial information |
674 | if ( m_dest ) | 672 | if ( m_dest ) |
675 | { | 673 | { |
676 | m_name->setText( m_dest->name() ); | 674 | m_name->setText( m_dest->name() ); |
677 | m_location->setText( m_dest->value() ); | 675 | m_location->setText( m_dest->value() ); |
678 | m_active->setChecked( m_dest->active() ); | 676 | m_active->setChecked( m_dest->active() ); |
679 | } | 677 | } |