summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
authorar <ar>2004-02-21 16:02:01 (UTC)
committer ar <ar>2004-02-21 16:02:01 (UTC)
commitdb2afda83e495bff9fc19fa14a30072f1cd4c67a (patch) (side-by-side diff)
tree0281ec10dad24d83179283370661ae9225016de0 /noncore/settings/aqpkg/mainwin.cpp
parent460258f203be746ff79e14f32a823f381b8ea513 (diff)
downloadopie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.zip
opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.gz
opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.bz2
improve support for BigScreen
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 @@
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
@@ -29,9 +29,17 @@
-#include <linux/limits.h>
-#include <unistd.h>
+#include "categoryfilterimpl.h"
+#include "datamgr.h"
+#include "global.h"
+#include "inputdlg.h"
+#include "ipkg.h"
+#include "installdlgimpl.h"
+#include "letterpushbutton.h"
+#include "mainwin.h"
+#include "packagewin.h"
+#include "settingsimpl.h"
+#include "utils.h"
+/* OPIE */
#include <qpe/qcopenvelope_qws.h>
-#include <qmenubar.h>
#include <qpe/qpeapplication.h>
-#include <qtoolbar.h>
#include <qpe/config.h>
@@ -39,2 +47,5 @@
+/* QT */
+#include <qmenubar.h>
+#include <qtoolbar.h>
#include <qaction.h>
@@ -54,13 +65,5 @@
-#include "categoryfilterimpl.h"
-#include "datamgr.h"
-#include "global.h"
-#include "inputdlg.h"
-#include "ipkg.h"
-#include "installdlgimpl.h"
-#include "letterpushbutton.h"
-#include "mainwin.h"
-#include "packagewin.h"
-#include "settingsimpl.h"
-#include "utils.h"
+/* STD */
+#include <linux/limits.h>
+#include <unistd.h>
@@ -69,3 +72,3 @@ extern int compareVersions( const char *v1, const char *v2 );
MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
- : QMainWindow( parent, name, fl || WStyle_ContextHelp )
+ : QMainWindow( parent, name, fl || WStyle_ContextHelp )
{
@@ -241,3 +244,3 @@ MainWindow :: ~MainWindow()
{
- delete mgr;
+ delete mgr;
@@ -298,3 +301,3 @@ void MainWindow :: init()
currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
-// showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
+ // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
@@ -339,4 +342,4 @@ void MainWindow :: setDocument( const QString &doc )
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
- item != 0 ;
- item = (QCheckListItem *)item->nextSibling() )
+ item != 0 ;
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -356,3 +359,3 @@ void MainWindow :: displaySettings()
stack->raiseWidget( progressWindow );
- updateData();
+ updateData();
stack->raiseWidget( networkPkgWindow );
@@ -584,8 +587,8 @@ void MainWindow :: updateData()
if ( serverName == currentlySelectedServer )
- activeItem = i;
- }
+ activeItem = i;
+ }
- // set selected server to be active server
- if ( activeItem != -1 )
- serversList->setCurrentItem( activeItem );
+ // set selected server to be active server
+ if ( activeItem != -1 )
+ serversList->setCurrentItem( activeItem );
serverSelected( 0, FALSE );
@@ -627,6 +630,6 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
#ifdef QWS
- // read download directory from config file
- Config cfg( "aqpkg" );
- cfg.setGroup( "settings" );
- cfg.writeEntry( "selectedServer", currentlySelectedServer );
+ // read download directory from config file
+ Config cfg( "aqpkg" );
+ cfg.setGroup( "settings" );
+ cfg.writeEntry( "selectedServer", currentlySelectedServer );
#endif
@@ -680,3 +683,3 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(),
- QCheckListItem::CheckBox );
+ QCheckListItem::CheckBox );
@@ -740,3 +743,3 @@ void MainWindow :: searchForPackage( const QString &text )
for ( QCheckListItem *item = start; item != 0 ;
- item = (QCheckListItem *)item->nextSibling() )
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -768,5 +771,5 @@ void MainWindow :: updateServer()
InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
- tr( "Update lists" ) );
+ tr( "Update lists" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- reloadDocuments = FALSE;
+ reloadDocuments = FALSE;
stack->addWidget( dlg, 3 );
@@ -774,3 +777,3 @@ void MainWindow :: updateServer()
-// delete progDlg;
+ // delete progDlg;
}
@@ -784,5 +787,5 @@ void MainWindow :: upgradePackages()
QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning,
- QMessageBox::Yes,
- QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ,
- 0, this );
+ QMessageBox::Yes,
+ QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ,
+ 0, this );
warn.adjustSize();
@@ -799,5 +802,5 @@ void MainWindow :: upgradePackages()
InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ),
- tr ( "Upgrade" ) );
+ tr ( "Upgrade" ) );
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- reloadDocuments = TRUE;
+ reloadDocuments = TRUE;
stack->addWidget( dlg, 3 );
@@ -817,4 +820,4 @@ void MainWindow :: downloadPackage()
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
- item != 0 && !found;
- item = (QCheckListItem *)item->nextSibling() )
+ item != 0 && !found;
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -838,4 +841,4 @@ void MainWindow :: downloadPackage()
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
- item != 0 ;
- item = (QCheckListItem *)item->nextSibling() )
+ item != 0 ;
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -857,3 +860,3 @@ void MainWindow :: downloadPackage()
if ( QMessageBox::information( this, tr( "Are you sure?" ),
- msgtext, tr( "No" ), tr( "Yes" ) ) == 1 )
+ msgtext, tr( "No" ), tr( "Yes" ) ) == 1 )
{
@@ -910,4 +913,4 @@ void MainWindow :: downloadSelectedPackages()
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
- item != 0 ;
- item = (QCheckListItem *)item->nextSibling() )
+ item != 0 ;
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -928,8 +931,8 @@ void MainWindow :: downloadRemotePackage()
return;
-// DownloadRemoteDlgImpl dlg( this, "Install", true );
-// if ( dlg.exec() == QDialog::Rejected )
-// return;
+ // DownloadRemoteDlgImpl dlg( this, "Install", true );
+ // if ( dlg.exec() == QDialog::Rejected )
+ // return;
// grab details from dialog
-// QString package = dlg.getPackageLocation();
+ // QString package = dlg.getPackageLocation();
@@ -944,3 +947,3 @@ void MainWindow :: downloadRemotePackage()
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- reloadDocuments = TRUE;
+ reloadDocuments = TRUE;
stack->addWidget( dlg, 3 );
@@ -963,4 +966,4 @@ void MainWindow :: applyChanges()
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
- item != 0 ;
- item = (QCheckListItem *)item->nextSibling() )
+ item != 0 ;
+ item = (QCheckListItem *)item->nextSibling() )
{
@@ -973,3 +976,3 @@ void MainWindow :: applyChanges()
return;
- }
+ }
}
@@ -980,3 +983,3 @@ void MainWindow :: applyChanges()
QMessageBox::information( this, tr( "Nothing to do" ),
- tr( "No packages selected" ), tr( "OK" ) );
+ tr( "No packages selected" ), tr( "OK" ) );
@@ -988,3 +991,3 @@ void MainWindow :: applyChanges()
connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
- reloadDocuments = TRUE;
+ reloadDocuments = TRUE;
stack->addWidget( dlg, 3 );
@@ -1026,3 +1029,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
name = item->text();
-
+
if ( !p->isPackageStoredLocally() )
@@ -1092,15 +1095,15 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
{
- case 0: // Cancel
- delete newitem;
- return 0x0;
- break;
- case 1: // Remove
- newitem->option = "D";
- // If local file, remove using package name, not filename
- if ( p->isPackageStoredLocally() )
- name = item->text();
- break;
- case 2: // Reinstall or Upgrade
- newitem->option = secondOption;
- break;
+ case 0: // Cancel
+ delete newitem;
+ return 0x0;
+ break;
+ case 1: // Remove
+ newitem->option = "D";
+ // If local file, remove using package name, not filename
+ if ( p->isPackageStoredLocally() )
+ name = item->text();
+ break;
+ case 2: // Reinstall or Upgrade
+ newitem->option = secondOption;
+ break;
}
@@ -1109,3 +1112,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
{
-// newitem->option = stickyOption;
+ // newitem->option = stickyOption;
}
@@ -1116,5 +1119,5 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
if ( newitem->option != "R" )
- newitem->recreateLinks = true;
+ newitem->recreateLinks = true;
else
- newitem->recreateLinks = false;
+ newitem->recreateLinks = false;
@@ -1140,10 +1143,10 @@ void MainWindow :: reloadData( InstallDlgImpl *dlg )
if ( reloadDocuments )
- {
- m_status->setText( tr( "Updating Launcher..." ) );
-
- // Finally let the main system update itself
- QCopEnvelope e("QPE/System", "linkChanged(QString)");
- QString lf = QString::null;
- e << lf;
- }
+ {
+ m_status->setText( tr( "Updating Launcher..." ) );
+
+ // Finally let the main system update itself
+ QCopEnvelope e("QPE/System", "linkChanged(QString)");
+ QString lf = QString::null;
+ e << lf;
+ }
#endif
@@ -1183,3 +1186,4 @@ void MainWindow :: letterPushed( QString t )
item = (QCheckListItem *)packagesList->firstChild();
- } while ( item != start);
+ }
+ while ( item != start);
}
@@ -1190,3 +1194,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
- p->showMaximized();
+ QPEApplication::showWidget( p );
}
@@ -1194,3 +1198,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn )
- : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
+ : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
{