summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp176
1 files changed, 90 insertions, 86 deletions
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
@@ -2,3 +2,3 @@
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>
@@ -29,9 +29,17 @@
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>
@@ -39,2 +47,5 @@
39 47
48/* QT */
49#include <qmenubar.h>
50#include <qtoolbar.h>
40#include <qaction.h> 51#include <qaction.h>
@@ -54,13 +65,5 @@
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
@@ -69,3 +72,3 @@ extern int compareVersions( const char *v1, const char *v2 );
69MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) 72MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
70 :QMainWindow( parent, name, fl || WStyle_ContextHelp ) 73 :QMainWindow( parent, name, fl || WStyle_ContextHelp )
71{ 74{
@@ -241,3 +244,3 @@ MainWindow :: ~MainWindow()
241{ 244{
242 delete mgr; 245 delete mgr;
243 246
@@ -298,3 +301,3 @@ void MainWindow :: init()
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
@@ -339,4 +342,4 @@ void MainWindow :: setDocument( const QString &doc )
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 {
@@ -356,3 +359,3 @@ void MainWindow :: displaySettings()
356 stack->raiseWidget( progressWindow ); 359 stack->raiseWidget( progressWindow );
357 updateData(); 360 updateData();
358 stack->raiseWidget( networkPkgWindow ); 361 stack->raiseWidget( networkPkgWindow );
@@ -584,8 +587,8 @@ void MainWindow :: updateData()
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 );
@@ -627,6 +630,6 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
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
@@ -680,3 +683,3 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
680 QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), 683 QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(),
681 QCheckListItem::CheckBox ); 684 QCheckListItem::CheckBox );
682 685
@@ -740,3 +743,3 @@ void MainWindow :: searchForPackage( const QString &text )
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 {
@@ -768,5 +771,5 @@ void MainWindow :: updateServer()
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 );
@@ -774,3 +777,3 @@ void MainWindow :: updateServer()
774 777
775// delete progDlg; 778 // delete progDlg;
776} 779}
@@ -784,5 +787,5 @@ void MainWindow :: upgradePackages()
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();
@@ -799,5 +802,5 @@ void MainWindow :: upgradePackages()
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 );
@@ -817,4 +820,4 @@ void MainWindow :: downloadPackage()
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 {
@@ -838,4 +841,4 @@ void MainWindow :: downloadPackage()
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 {
@@ -857,3 +860,3 @@ void MainWindow :: downloadPackage()
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 {
@@ -910,4 +913,4 @@ void MainWindow :: downloadSelectedPackages()
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 {
@@ -928,8 +931,8 @@ void MainWindow :: downloadRemotePackage()
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
@@ -944,3 +947,3 @@ void MainWindow :: downloadRemotePackage()
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 );
@@ -963,4 +966,4 @@ void MainWindow :: applyChanges()
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 {
@@ -973,3 +976,3 @@ void MainWindow :: applyChanges()
973 return; 976 return;
974 } 977 }
975 } 978 }
@@ -980,3 +983,3 @@ void MainWindow :: applyChanges()
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
@@ -988,3 +991,3 @@ void MainWindow :: applyChanges()
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 );
@@ -1026,3 +1029,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1026 name = item->text(); 1029 name = item->text();
1027 1030
1028 if ( !p->isPackageStoredLocally() ) 1031 if ( !p->isPackageStoredLocally() )
@@ -1092,15 +1095,15 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
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 }
@@ -1109,3 +1112,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1109 { 1112 {
1110// newitem->option = stickyOption; 1113 // newitem->option = stickyOption;
1111 } 1114 }
@@ -1116,5 +1119,5 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
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
@@ -1140,10 +1143,10 @@ void MainWindow :: reloadData( InstallDlgImpl *dlg )
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
@@ -1183,3 +1186,4 @@ void MainWindow :: letterPushed( QString t )
1183 item = (QCheckListItem *)packagesList->firstChild(); 1186 item = (QCheckListItem *)packagesList->firstChild();
1184 } while ( item != start); 1187 }
1188 while ( item != start);
1185} 1189}
@@ -1190,3 +1194,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
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}
@@ -1194,3 +1198,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
1194QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) 1198QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn )
1195 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog ) 1199 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
1196{ 1200{