author | ar <ar> | 2004-02-21 16:02:01 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-21 16:02:01 (UTC) |
commit | db2afda83e495bff9fc19fa14a30072f1cd4c67a (patch) (unidiff) | |
tree | 0281ec10dad24d83179283370661ae9225016de0 /noncore/settings/aqpkg | |
parent | 460258f203be746ff79e14f32a823f381b8ea513 (diff) | |
download | opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.zip opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.gz opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.bz2 |
improve support for BigScreen
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.cpp | 28 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.cpp | 44 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 176 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 243 |
4 files changed, 252 insertions, 239 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 | |||
@@ -27,18 +27,24 @@ | |||
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <iostream> | 30 | #include "categoryfilterimpl.h" |
31 | using namespace std; | 31 | |
32 | /* OPIE */ | ||
33 | #include <qpe/qpeapplication.h> | ||
32 | 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> | ||
43 | using namespace std; | ||
44 | |||
39 | 45 | ||
40 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) | 46 | CategoryFilterImpl :: 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 | ||
@@ -52,11 +58,11 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin | |||
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 | ||
@@ -76,16 +82,16 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin | |||
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 | ||
86 | CategoryFilterImpl :: ~CategoryFilterImpl() | 93 | CategoryFilterImpl :: ~CategoryFilterImpl() |
87 | { | 94 | {} |
88 | } | ||
89 | 95 | ||
90 | QString CategoryFilterImpl :: getSelectedFilter() | 96 | QString CategoryFilterImpl :: getSelectedFilter() |
91 | { | 97 | { |
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 | |||
@@ -27,25 +27,28 @@ | |||
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 | |||
44 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) | 47 | InstallOptionsDlgImpl::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 ); |
@@ -56,7 +59,7 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par | |||
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 | ||
@@ -71,7 +74,7 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par | |||
71 | 74 | ||
72 | QLabel *l = new QLabel( tr( "Information Level" ), grpbox ); | 75 | QLabel *l = new QLabel( tr( "Information Level" ), grpbox ); |
73 | grplayout->addWidget( l ); | 76 | grplayout->addWidget( l ); |
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" ) ); |
@@ -79,29 +82,28 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par | |||
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 | ||
102 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() | 105 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() |
103 | { | 106 | {} |
104 | } | ||
105 | 107 | ||
106 | 108 | ||
107 | int InstallOptionsDlgImpl :: getFlags() | 109 | int InstallOptionsDlgImpl :: getFlags() |
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 | |||
@@ -1,6 +1,6 @@ | |||
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) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
@@ -27,16 +27,27 @@ | |||
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> |
@@ -52,22 +63,14 @@ | |||
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 | ||
67 | extern int compareVersions( const char *v1, const char *v2 ); | 70 | extern int compareVersions( const char *v1, const char *v2 ); |
68 | 71 | ||
69 | MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) | 72 | MainWindow :: 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; |
@@ -239,7 +242,7 @@ MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) | |||
239 | 242 | ||
240 | MainWindow :: ~MainWindow() | 243 | MainWindow :: ~MainWindow() |
241 | { | 244 | { |
242 | delete mgr; | 245 | delete mgr; |
243 | 246 | ||
244 | // Reenable suspend mode | 247 | // Reenable suspend mode |
245 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 248 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
@@ -296,7 +299,7 @@ void MainWindow :: init() | |||
296 | Config cfg( "aqpkg" ); | 299 | Config cfg( "aqpkg" ); |
297 | cfg.setGroup( "settings" ); | 300 | cfg.setGroup( "settings" ); |
298 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); | 301 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); |
299 | // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); | 302 | // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); |
300 | 303 | ||
301 | #endif | 304 | #endif |
302 | 305 | ||
@@ -337,8 +340,8 @@ void MainWindow :: setDocument( const QString &doc ) | |||
337 | 340 | ||
338 | // Now set the check box of the selected package | 341 | // Now set the check box of the selected package |
339 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 342 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
340 | item != 0 ; | 343 | item != 0 ; |
341 | item = (QCheckListItem *)item->nextSibling() ) | 344 | item = (QCheckListItem *)item->nextSibling() ) |
342 | { | 345 | { |
343 | if ( item->text().startsWith( package ) ) | 346 | if ( item->text().startsWith( package ) ) |
344 | { | 347 | { |
@@ -354,7 +357,7 @@ void MainWindow :: displaySettings() | |||
354 | if ( dlg->showDlg() ) | 357 | if ( dlg->showDlg() ) |
355 | { | 358 | { |
356 | stack->raiseWidget( progressWindow ); | 359 | stack->raiseWidget( progressWindow ); |
357 | updateData(); | 360 | updateData(); |
358 | stack->raiseWidget( networkPkgWindow ); | 361 | stack->raiseWidget( networkPkgWindow ); |
359 | } | 362 | } |
360 | delete dlg; | 363 | delete dlg; |
@@ -582,12 +585,12 @@ void MainWindow :: updateData() | |||
582 | 585 | ||
583 | serversList->insertItem( serverName ); | 586 | serversList->insertItem( serverName ); |
584 | if ( serverName == currentlySelectedServer ) | 587 | if ( serverName == currentlySelectedServer ) |
585 | activeItem = i; | 588 | activeItem = i; |
586 | } | 589 | } |
587 | 590 | ||
588 | // set selected server to be active server | 591 | // set selected server to be active server |
589 | if ( activeItem != -1 ) | 592 | if ( activeItem != -1 ) |
590 | serversList->setCurrentItem( activeItem ); | 593 | serversList->setCurrentItem( activeItem ); |
591 | serverSelected( 0, FALSE ); | 594 | serverSelected( 0, FALSE ); |
592 | } | 595 | } |
593 | 596 | ||
@@ -625,10 +628,10 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
625 | packagesList->clear(); | 628 | packagesList->clear(); |
626 | 629 | ||
627 | #ifdef QWS | 630 | #ifdef QWS |
628 | // read download directory from config file | 631 | // read download directory from config file |
629 | Config cfg( "aqpkg" ); | 632 | Config cfg( "aqpkg" ); |
630 | cfg.setGroup( "settings" ); | 633 | cfg.setGroup( "settings" ); |
631 | cfg.writeEntry( "selectedServer", currentlySelectedServer ); | 634 | cfg.writeEntry( "selectedServer", currentlySelectedServer ); |
632 | #endif | 635 | #endif |
633 | 636 | ||
634 | int i = 0; | 637 | int i = 0; |
@@ -678,7 +681,7 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
678 | 681 | ||
679 | 682 | ||
680 | QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), | 683 | QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), |
681 | QCheckListItem::CheckBox ); | 684 | QCheckListItem::CheckBox ); |
682 | 685 | ||
683 | if ( package->isInstalled() ) | 686 | if ( package->isInstalled() ) |
684 | { | 687 | { |
@@ -738,7 +741,7 @@ void MainWindow :: searchForPackage( const QString &text ) | |||
738 | start = (QCheckListItem *)packagesList->firstChild(); | 741 | start = (QCheckListItem *)packagesList->firstChild(); |
739 | 742 | ||
740 | for ( QCheckListItem *item = start; item != 0 ; | 743 | for ( QCheckListItem *item = start; item != 0 ; |
741 | item = (QCheckListItem *)item->nextSibling() ) | 744 | item = (QCheckListItem *)item->nextSibling() ) |
742 | { | 745 | { |
743 | if ( item->text().lower().find( text ) != -1 ) | 746 | if ( item->text().lower().find( text ) != -1 ) |
744 | { | 747 | { |
@@ -766,13 +769,13 @@ void MainWindow :: updateServer() | |||
766 | ipkg->setOption( "update" ); | 769 | ipkg->setOption( "update" ); |
767 | 770 | ||
768 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), | 771 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), |
769 | tr( "Update lists" ) ); | 772 | tr( "Update lists" ) ); |
770 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 773 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
771 | reloadDocuments = FALSE; | 774 | reloadDocuments = FALSE; |
772 | stack->addWidget( dlg, 3 ); | 775 | stack->addWidget( dlg, 3 ); |
773 | stack->raiseWidget( dlg ); | 776 | stack->raiseWidget( dlg ); |
774 | 777 | ||
775 | // delete progDlg; | 778 | // delete progDlg; |
776 | } | 779 | } |
777 | 780 | ||
778 | void MainWindow :: upgradePackages() | 781 | void MainWindow :: upgradePackages() |
@@ -782,9 +785,9 @@ void MainWindow :: upgradePackages() | |||
782 | // TODO - ODevice???? | 785 | // TODO - ODevice???? |
783 | QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); | 786 | QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); |
784 | QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning, | 787 | QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning, |
785 | QMessageBox::Yes, | 788 | QMessageBox::Yes, |
786 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , | 789 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , |
787 | 0, this ); | 790 | 0, this ); |
788 | warn.adjustSize(); | 791 | warn.adjustSize(); |
789 | 792 | ||
790 | if ( warn.exec() == QMessageBox::Yes ) | 793 | if ( warn.exec() == QMessageBox::Yes ) |
@@ -797,9 +800,9 @@ void MainWindow :: upgradePackages() | |||
797 | ipkg->setOption( "upgrade" ); | 800 | ipkg->setOption( "upgrade" ); |
798 | 801 | ||
799 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), | 802 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), |
800 | tr ( "Upgrade" ) ); | 803 | tr ( "Upgrade" ) ); |
801 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 804 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
802 | reloadDocuments = TRUE; | 805 | reloadDocuments = TRUE; |
803 | stack->addWidget( dlg, 3 ); | 806 | stack->addWidget( dlg, 3 ); |
804 | stack->raiseWidget( dlg ); | 807 | stack->raiseWidget( dlg ); |
805 | } | 808 | } |
@@ -815,8 +818,8 @@ void MainWindow :: downloadPackage() | |||
815 | if ( serversList->currentText() != LOCAL_SERVER ) | 818 | if ( serversList->currentText() != LOCAL_SERVER ) |
816 | { | 819 | { |
817 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 820 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
818 | item != 0 && !found; | 821 | item != 0 && !found; |
819 | item = (QCheckListItem *)item->nextSibling() ) | 822 | item = (QCheckListItem *)item->nextSibling() ) |
820 | { | 823 | { |
821 | if ( item->isOn() ) | 824 | if ( item->isOn() ) |
822 | found = true; | 825 | found = true; |
@@ -836,8 +839,8 @@ void MainWindow :: downloadPackage() | |||
836 | { | 839 | { |
837 | doUpdate = false; | 840 | doUpdate = false; |
838 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 841 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
839 | item != 0 ; | 842 | item != 0 ; |
840 | item = (QCheckListItem *)item->nextSibling() ) | 843 | item = (QCheckListItem *)item->nextSibling() ) |
841 | { | 844 | { |
842 | if ( item->isOn() ) | 845 | if ( item->isOn() ) |
843 | { | 846 | { |
@@ -855,7 +858,7 @@ void MainWindow :: downloadPackage() | |||
855 | QString msgtext; | 858 | QString msgtext; |
856 | msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() ); | 859 | msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() ); |
857 | if ( QMessageBox::information( this, tr( "Are you sure?" ), | 860 | if ( QMessageBox::information( this, tr( "Are you sure?" ), |
858 | msgtext, tr( "No" ), tr( "Yes" ) ) == 1 ) | 861 | msgtext, tr( "No" ), tr( "Yes" ) ) == 1 ) |
859 | { | 862 | { |
860 | doUpdate = true; | 863 | doUpdate = true; |
861 | QFile f( p->getFilename() ); | 864 | QFile f( p->getFilename() ); |
@@ -908,8 +911,8 @@ void MainWindow :: downloadSelectedPackages() | |||
908 | ipkg.setOption( "download" ); | 911 | ipkg.setOption( "download" ); |
909 | ipkg.setRuntimeDirectory( dir ); | 912 | ipkg.setRuntimeDirectory( dir ); |
910 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 913 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
911 | item != 0 ; | 914 | item != 0 ; |
912 | item = (QCheckListItem *)item->nextSibling() ) | 915 | item = (QCheckListItem *)item->nextSibling() ) |
913 | { | 916 | { |
914 | if ( item->isOn() ) | 917 | if ( item->isOn() ) |
915 | { | 918 | { |
@@ -926,12 +929,12 @@ void MainWindow :: downloadRemotePackage() | |||
926 | QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this ); | 929 | QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this ); |
927 | if ( !ok || package.isEmpty() ) | 930 | if ( !ok || package.isEmpty() ) |
928 | return; | 931 | return; |
929 | // DownloadRemoteDlgImpl dlg( this, "Install", true ); | 932 | // DownloadRemoteDlgImpl dlg( this, "Install", true ); |
930 | // if ( dlg.exec() == QDialog::Rejected ) | 933 | // if ( dlg.exec() == QDialog::Rejected ) |
931 | // return; | 934 | // return; |
932 | 935 | ||
933 | // grab details from dialog | 936 | // grab details from dialog |
934 | // QString package = dlg.getPackageLocation(); | 937 | // QString package = dlg.getPackageLocation(); |
935 | 938 | ||
936 | InstallData *item = new InstallData(); | 939 | InstallData *item = new InstallData(); |
937 | item->option = "I"; | 940 | item->option = "I"; |
@@ -942,7 +945,7 @@ void MainWindow :: downloadRemotePackage() | |||
942 | 945 | ||
943 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); | 946 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); |
944 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 947 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
945 | reloadDocuments = TRUE; | 948 | reloadDocuments = TRUE; |
946 | stack->addWidget( dlg, 3 ); | 949 | stack->addWidget( dlg, 3 ); |
947 | stack->raiseWidget( dlg ); | 950 | stack->raiseWidget( dlg ); |
948 | } | 951 | } |
@@ -961,8 +964,8 @@ void MainWindow :: applyChanges() | |||
961 | QList<InstallData> workingPackages; | 964 | QList<InstallData> workingPackages; |
962 | workingPackages.setAutoDelete( TRUE ); | 965 | workingPackages.setAutoDelete( TRUE ); |
963 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 966 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
964 | item != 0 ; | 967 | item != 0 ; |
965 | item = (QCheckListItem *)item->nextSibling() ) | 968 | item = (QCheckListItem *)item->nextSibling() ) |
966 | { | 969 | { |
967 | if ( item->isOn() ) | 970 | if ( item->isOn() ) |
968 | { | 971 | { |
@@ -971,14 +974,14 @@ void MainWindow :: applyChanges() | |||
971 | workingPackages.append( instdata ); | 974 | workingPackages.append( instdata ); |
972 | else | 975 | else |
973 | return; | 976 | return; |
974 | } | 977 | } |
975 | } | 978 | } |
976 | 979 | ||
977 | if ( workingPackages.count() == 0 ) | 980 | if ( workingPackages.count() == 0 ) |
978 | { | 981 | { |
979 | // Nothing to do | 982 | // Nothing to do |
980 | QMessageBox::information( this, tr( "Nothing to do" ), | 983 | QMessageBox::information( this, tr( "Nothing to do" ), |
981 | tr( "No packages selected" ), tr( "OK" ) ); | 984 | tr( "No packages selected" ), tr( "OK" ) ); |
982 | 985 | ||
983 | return; | 986 | return; |
984 | } | 987 | } |
@@ -986,7 +989,7 @@ void MainWindow :: applyChanges() | |||
986 | // do the stuff | 989 | // do the stuff |
987 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); | 990 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); |
988 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 991 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
989 | reloadDocuments = TRUE; | 992 | reloadDocuments = TRUE; |
990 | stack->addWidget( dlg, 3 ); | 993 | stack->addWidget( dlg, 3 ); |
991 | stack->raiseWidget( dlg ); | 994 | stack->raiseWidget( dlg ); |
992 | } | 995 | } |
@@ -1024,7 +1027,7 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1024 | // If local file, remove using package name, not filename | 1027 | // If local file, remove using package name, not filename |
1025 | if ( p->isPackageStoredLocally() ) | 1028 | if ( p->isPackageStoredLocally() ) |
1026 | name = item->text(); | 1029 | name = item->text(); |
1027 | 1030 | ||
1028 | if ( !p->isPackageStoredLocally() ) | 1031 | if ( !p->isPackageStoredLocally() ) |
1029 | newitem->packageName = p->getInstalledPackageName(); | 1032 | newitem->packageName = p->getInstalledPackageName(); |
1030 | else | 1033 | else |
@@ -1090,33 +1093,33 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1090 | QuestionDlg dlg( text, msgtext, secondButton ); | 1093 | QuestionDlg dlg( text, msgtext, secondButton ); |
1091 | switch( dlg.exec() ) | 1094 | switch( dlg.exec() ) |
1092 | { | 1095 | { |
1093 | case 0: // Cancel | 1096 | case 0: // Cancel |
1094 | delete newitem; | 1097 | delete newitem; |
1095 | return 0x0; | 1098 | return 0x0; |
1096 | break; | 1099 | break; |
1097 | case 1: // Remove | 1100 | case 1: // Remove |
1098 | newitem->option = "D"; | 1101 | newitem->option = "D"; |
1099 | // If local file, remove using package name, not filename | 1102 | // If local file, remove using package name, not filename |
1100 | if ( p->isPackageStoredLocally() ) | 1103 | if ( p->isPackageStoredLocally() ) |
1101 | name = item->text(); | 1104 | name = item->text(); |
1102 | break; | 1105 | break; |
1103 | case 2: // Reinstall or Upgrade | 1106 | case 2: // Reinstall or Upgrade |
1104 | newitem->option = secondOption; | 1107 | newitem->option = secondOption; |
1105 | break; | 1108 | break; |
1106 | } | 1109 | } |
1107 | } | 1110 | } |
1108 | else | 1111 | else |
1109 | { | 1112 | { |
1110 | // newitem->option = stickyOption; | 1113 | // newitem->option = stickyOption; |
1111 | } | 1114 | } |
1112 | } | 1115 | } |
1113 | 1116 | ||
1114 | 1117 | ||
1115 | // Check if we are reinstalling the same version | 1118 | // Check if we are reinstalling the same version |
1116 | if ( newitem->option != "R" ) | 1119 | if ( newitem->option != "R" ) |
1117 | newitem->recreateLinks = true; | 1120 | newitem->recreateLinks = true; |
1118 | else | 1121 | else |
1119 | newitem->recreateLinks = false; | 1122 | newitem->recreateLinks = false; |
1120 | 1123 | ||
1121 | // User hit cancel (on dlg - assume remove) | 1124 | // User hit cancel (on dlg - assume remove) |
1122 | return newitem; | 1125 | return newitem; |
@@ -1138,14 +1141,14 @@ void MainWindow :: reloadData( InstallDlgImpl *dlg ) | |||
1138 | 1141 | ||
1139 | #ifdef QWS | 1142 | #ifdef QWS |
1140 | if ( reloadDocuments ) | 1143 | if ( reloadDocuments ) |
1141 | { | 1144 | { |
1142 | m_status->setText( tr( "Updating Launcher..." ) ); | 1145 | m_status->setText( tr( "Updating Launcher..." ) ); |
1143 | 1146 | ||
1144 | // Finally let the main system update itself | 1147 | // Finally let the main system update itself |
1145 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 1148 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
1146 | QString lf = QString::null; | 1149 | QString lf = QString::null; |
1147 | e << lf; | 1150 | e << lf; |
1148 | } | 1151 | } |
1149 | #endif | 1152 | #endif |
1150 | 1153 | ||
1151 | stack->raiseWidget( networkPkgWindow ); | 1154 | stack->raiseWidget( networkPkgWindow ); |
@@ -1181,18 +1184,19 @@ void MainWindow :: letterPushed( QString t ) | |||
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 | ||
1187 | void MainWindow :: slotDisplayPackage( QListViewItem *item ) | 1191 | void 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 | ||
1194 | QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) | 1198 | QuestionDlg::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 ); |
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 | |||
@@ -24,13 +24,21 @@ | |||
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" |
32 | using namespace std; | ||
33 | 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> | ||
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> |
@@ -39,22 +47,16 @@ using namespace std; | |||
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> | 53 | using namespace std; |
46 | #include <qpe/resource.h> | ||
47 | #endif | ||
48 | |||
49 | #include "settingsimpl.h" | ||
50 | |||
51 | #include "global.h" | ||
52 | 54 | ||
53 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 55 | SettingsImpl :: 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 ); |
@@ -68,7 +70,7 @@ SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const | |||
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; |
@@ -78,18 +80,15 @@ SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const | |||
78 | 80 | ||
79 | SettingsImpl :: ~SettingsImpl() | 81 | SettingsImpl :: ~SettingsImpl() |
80 | { | 82 | { |
81 | |||
82 | } | 83 | } |
83 | 84 | ||
84 | bool SettingsImpl :: showDlg() | 85 | bool SettingsImpl :: showDlg() |
85 | { | 86 | { |
86 | showMaximized(); | 87 | QPEApplication::execDialog( this ); |
87 | exec(); | 88 | if ( changed ) |
88 | 89 | dataMgr->writeOutIpkgConf(); | |
89 | if ( changed ) | ||
90 | dataMgr->writeOutIpkgConf(); | ||
91 | 90 | ||
92 | return changed; | 91 | return changed; |
93 | } | 92 | } |
94 | 93 | ||
95 | QWidget *SettingsImpl :: initServerTab() | 94 | QWidget *SettingsImpl :: initServerTab() |
@@ -118,18 +117,18 @@ QWidget *SettingsImpl :: initServerTab() | |||
118 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 117 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
119 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); | 118 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); |
120 | layout->addWidget( btn, 1, 0 ); | 119 | layout->addWidget( btn, 1, 0 ); |
121 | 120 | ||
122 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 121 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
123 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); | 122 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); |
124 | layout->addWidget( btn, 1, 1 ); | 123 | layout->addWidget( btn, 1, 1 ); |
125 | 124 | ||
126 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 125 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
127 | grpbox->layout()->setSpacing( 2 ); | 126 | grpbox->layout()->setSpacing( 2 ); |
128 | grpbox->layout()->setMargin( 4 ); | 127 | grpbox->layout()->setMargin( 4 ); |
129 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 128 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
130 | 129 | ||
131 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 130 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
132 | 131 | ||
133 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 132 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
134 | grplayout->addWidget( label, 0, 0 ); | 133 | grplayout->addWidget( label, 0, 0 ); |
135 | servername = new QLineEdit( grpbox ); | 134 | servername = new QLineEdit( grpbox ); |
@@ -142,11 +141,11 @@ QWidget *SettingsImpl :: initServerTab() | |||
142 | 141 | ||
143 | active = new QCheckBox( tr( "Active Server" ), grpbox ); | 142 | active = new QCheckBox( tr( "Active Server" ), grpbox ); |
144 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); | 143 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); |
145 | 144 | ||
146 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 145 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
147 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); | 146 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); |
148 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 147 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
149 | 148 | ||
150 | return control; | 149 | return control; |
151 | } | 150 | } |
152 | 151 | ||
@@ -176,18 +175,18 @@ QWidget *SettingsImpl :: initDestinationTab() | |||
176 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 175 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
177 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); | 176 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); |
178 | layout->addWidget( btn, 1, 0 ); | 177 | layout->addWidget( btn, 1, 0 ); |
179 | 178 | ||
180 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 179 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
181 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); | 180 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); |
182 | layout->addWidget( btn, 1, 1 ); | 181 | layout->addWidget( btn, 1, 1 ); |
183 | 182 | ||
184 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); | 183 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); |
185 | grpbox->layout()->setSpacing( 2 ); | 184 | grpbox->layout()->setSpacing( 2 ); |
186 | grpbox->layout()->setMargin( 4 ); | 185 | grpbox->layout()->setMargin( 4 ); |
187 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 186 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
188 | 187 | ||
189 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 188 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
190 | 189 | ||
191 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 190 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
192 | grplayout->addWidget( label, 0, 0 ); | 191 | grplayout->addWidget( label, 0, 0 ); |
193 | destinationname = new QLineEdit( grpbox ); | 192 | destinationname = new QLineEdit( grpbox ); |
@@ -200,11 +199,11 @@ QWidget *SettingsImpl :: initDestinationTab() | |||
200 | 199 | ||
201 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); | 200 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); |
202 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); | 201 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); |
203 | 202 | ||
204 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 203 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
205 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); | 204 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); |
206 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 205 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
207 | 206 | ||
208 | return control; | 207 | return control; |
209 | } | 208 | } |
210 | 209 | ||
@@ -235,7 +234,7 @@ QWidget *SettingsImpl :: initProxyTab() | |||
235 | grplayout->addWidget( txtHttpProxy ); | 234 | grplayout->addWidget( txtHttpProxy ); |
236 | chkHttpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | 235 | chkHttpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); |
237 | grplayout->addWidget( chkHttpProxyEnabled ); | 236 | grplayout->addWidget( chkHttpProxyEnabled ); |
238 | 237 | ||
239 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); | 238 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); |
240 | grpbox->layout()->setSpacing( 2 ); | 239 | grpbox->layout()->setSpacing( 2 ); |
241 | grpbox->layout()->setMargin( 4 ); | 240 | grpbox->layout()->setMargin( 4 ); |
@@ -245,7 +244,7 @@ QWidget *SettingsImpl :: initProxyTab() | |||
245 | grplayout->addWidget( txtFtpProxy ); | 244 | grplayout->addWidget( txtFtpProxy ); |
246 | chkFtpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | 245 | chkFtpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); |
247 | grplayout->addWidget( chkFtpProxyEnabled ); | 246 | grplayout->addWidget( chkFtpProxyEnabled ); |
248 | 247 | ||
249 | QLabel *label = new QLabel( tr( "Username:" ), container ); | 248 | QLabel *label = new QLabel( tr( "Username:" ), container ); |
250 | layout->addWidget( label, 2, 0 ); | 249 | layout->addWidget( label, 2, 0 ); |
251 | txtUsername = new QLineEdit( container ); | 250 | txtUsername = new QLineEdit( container ); |
@@ -259,7 +258,7 @@ QWidget *SettingsImpl :: initProxyTab() | |||
259 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); | 258 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); |
260 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); | 259 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); |
261 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); | 260 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); |
262 | 261 | ||
263 | return control; | 262 | return control; |
264 | } | 263 | } |
265 | 264 | ||
@@ -269,20 +268,20 @@ void SettingsImpl :: setupData() | |||
269 | QString serverName; | 268 | QString serverName; |
270 | QListIterator<Server> it( dataMgr->getServerList() ); | 269 | QListIterator<Server> it( dataMgr->getServerList() ); |
271 | for ( ; it.current(); ++it ) | 270 | for ( ; it.current(); ++it ) |
272 | { | 271 | { |
273 | serverName = it.current()->getServerName(); | 272 | serverName = it.current()->getServerName(); |
274 | if ( serverName == LOCAL_SERVER || serverName == LOCAL_IPKGS ) | 273 | if ( serverName == LOCAL_SERVER || serverName == LOCAL_IPKGS ) |
275 | continue; | 274 | continue; |
276 | 275 | ||
277 | servers->insertItem( serverName ); | 276 | servers->insertItem( serverName ); |
278 | } | 277 | } |
279 | 278 | ||
280 | 279 | ||
281 | // add destinations | 280 | // add destinations |
282 | QListIterator<Destination> it2( dataMgr->getDestinationList() ); | 281 | QListIterator<Destination> it2( dataMgr->getDestinationList() ); |
283 | for ( ; it2.current(); ++it2 ) | 282 | for ( ; it2.current(); ++it2 ) |
284 | destinations->insertItem( it2.current()->getDestinationName() ); | 283 | destinations->insertItem( it2.current()->getDestinationName() ); |
285 | 284 | ||
286 | // setup proxy tab | 285 | // setup proxy tab |
287 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); | 286 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); |
288 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); | 287 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); |
@@ -336,53 +335,53 @@ void SettingsImpl :: removeServer() | |||
336 | 335 | ||
337 | void SettingsImpl :: changeServerDetails() | 336 | void SettingsImpl :: changeServerDetails() |
338 | { | 337 | { |
339 | changed = true; | 338 | changed = true; |
340 | 339 | ||
341 | QString newName = servername->text(); | 340 | QString newName = servername->text(); |
342 | 341 | ||
343 | // Convert any spaces to underscores | 342 | // Convert any spaces to underscores |
344 | char *tmpStr = new char[newName.length() + 1]; | 343 | char *tmpStr = new char[newName.length() + 1]; |
345 | for ( unsigned int i = 0 ; i < newName.length() ; ++i ) | 344 | for ( unsigned int i = 0 ; i < newName.length() ; ++i ) |
346 | { | 345 | { |
347 | if ( newName[i] == ' ' ) | 346 | if ( newName[i] == ' ' ) |
348 | tmpStr[i] = '_'; | 347 | tmpStr[i] = '_'; |
349 | else | 348 | else |
350 | tmpStr[i] = newName[i].latin1(); | 349 | tmpStr[i] = newName[i].latin1(); |
351 | } | 350 | } |
352 | tmpStr[newName.length()] = '\0'; | 351 | tmpStr[newName.length()] = '\0'; |
353 | 352 | ||
354 | newName = tmpStr; | 353 | newName = tmpStr; |
355 | delete tmpStr; | 354 | delete tmpStr; |
356 | 355 | ||
357 | if ( !newserver ) | 356 | if ( !newserver ) |
358 | { | 357 | { |
359 | Server *s = dataMgr->getServer( servers->currentText() ); | 358 | Server *s = dataMgr->getServer( servers->currentText() ); |
360 | if ( s ) | 359 | if ( s ) |
361 | { | 360 | { |
362 | // Update url | 361 | // Update url |
363 | s->setServerUrl( serverurl->text() ); | 362 | s->setServerUrl( serverurl->text() ); |
364 | s->setActive( active->isChecked() ); | 363 | s->setActive( active->isChecked() ); |
365 | 364 | ||
366 | // Check if server name has changed, if it has then we need to replace the key in the map | 365 | // Check if server name has changed, if it has then we need to replace the key in the map |
367 | if ( serverName != newName ) | 366 | if ( serverName != newName ) |
368 | { | 367 | { |
369 | // Update server name | 368 | // Update server name |
370 | s->setServerName( newName ); | 369 | s->setServerName( newName ); |
371 | } | 370 | } |
372 | 371 | ||
373 | // Update list box | 372 | // Update list box |
374 | servers->changeItem( newName, currentSelectedServer ); | 373 | servers->changeItem( newName, currentSelectedServer ); |
375 | } | 374 | } |
376 | } | 375 | } |
377 | else | 376 | else |
378 | { | 377 | { |
379 | Server s( newName, serverurl->text() ); | 378 | Server s( newName, serverurl->text() ); |
380 | dataMgr->getServerList().append( new Server( newName, serverurl->text() ) ); | 379 | dataMgr->getServerList().append( new Server( newName, serverurl->text() ) ); |
381 | dataMgr->getServerList().last()->setActive( active->isChecked() ); | 380 | dataMgr->getServerList().last()->setActive( active->isChecked() ); |
382 | servers->insertItem( newName ); | 381 | servers->insertItem( newName ); |
383 | servers->setCurrentItem( servers->count() ); | 382 | servers->setCurrentItem( servers->count() ); |
384 | newserver = false; | 383 | newserver = false; |
385 | } | 384 | } |
386 | } | 385 | } |
387 | 386 | ||
388 | //------------------ Destinations tab ---------------------- | 387 | //------------------ Destinations tab ---------------------- |
@@ -409,10 +408,10 @@ void SettingsImpl :: editDestination( int sel ) | |||
409 | 408 | ||
410 | void SettingsImpl :: newDestination() | 409 | void SettingsImpl :: newDestination() |
411 | { | 410 | { |
412 | newdestination = true; | 411 | newdestination = true; |
413 | destinationname->setText( "" ); | 412 | destinationname->setText( "" ); |
414 | destinationurl->setText( "" ); | 413 | destinationurl->setText( "" ); |
415 | destinationname->setFocus(); | 414 | destinationname->setFocus(); |
416 | linkToRoot->setChecked( true ); | 415 | linkToRoot->setChecked( true ); |
417 | } | 416 | } |
418 | 417 | ||
@@ -429,7 +428,7 @@ void SettingsImpl :: removeDestination() | |||
429 | 428 | ||
430 | void SettingsImpl :: changeDestinationDetails() | 429 | void SettingsImpl :: changeDestinationDetails() |
431 | { | 430 | { |
432 | changed = true; | 431 | changed = true; |
433 | 432 | ||
434 | #ifdef QWS | 433 | #ifdef QWS |
435 | Config cfg( "aqpkg" ); | 434 | Config cfg( "aqpkg" ); |
@@ -437,46 +436,48 @@ void SettingsImpl :: changeDestinationDetails() | |||
437 | #endif | 436 | #endif |
438 | 437 | ||
439 | QString newName = destinationname->text(); | 438 | QString newName = destinationname->text(); |
440 | if ( !newdestination ) | 439 | if ( !newdestination ) |
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 |
465 | } | 464 | |
466 | } | 465 | } |
467 | else | 466 | } |
468 | { | 467 | else |
469 | dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) ); | 468 | { |
470 | destinations->insertItem( newName ); | 469 | dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) ); |
471 | destinations->setCurrentItem( destinations->count() ); | 470 | destinations->insertItem( newName ); |
472 | newdestination = false; | 471 | destinations->setCurrentItem( destinations->count() ); |
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 ---------------------- |