summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/.cvsignore4
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro3
-rw-r--r--noncore/settings/aqpkg/categoryfilter.ui123
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp33
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.h11
-rw-r--r--noncore/settings/aqpkg/instoptions.ui167
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp37
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.h14
8 files changed, 79 insertions, 313 deletions
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore
index 12658fc..2888d4a 100644
--- a/noncore/settings/aqpkg/.cvsignore
+++ b/noncore/settings/aqpkg/.cvsignore
@@ -1,6 +1,2 @@
Makefile*
-instoptions.cpp
-instoptions.h
moc*
-categoryfilter.cpp
-categoryfilter.h
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro
index f66fd95..6b4fb30 100644
--- a/noncore/settings/aqpkg/aqpkg.pro
+++ b/noncore/settings/aqpkg/aqpkg.pro
@@ -27,18 +27,17 @@ SOURCES = mainwin.cpp \
destination.cpp \
utils.cpp \
server.cpp \
helpwindow.cpp \
letterpushbutton.cpp \
inputdlg.cpp \
version.cpp \
categoryfilterimpl.cpp
-INTERFACES = instoptions.ui \
- categoryfilter.ui
+INTERFACES =
TARGET = aqpkg
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie -lstdc++
DESTDIR = $(OPIEDIR)/bin
TRANSLATIONS = ../../../i18n/de/aqpkg.ts \
../../../i18n/xx/aqpkg.ts \
diff --git a/noncore/settings/aqpkg/categoryfilter.ui b/noncore/settings/aqpkg/categoryfilter.ui
deleted file mode 100644
index c167cc9..0000000
--- a/noncore/settings/aqpkg/categoryfilter.ui
+++ b/dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>CategoryFilterDlg</class>
-<widget>
- <class>QDialog</class>
- <property stdset="1">
- <name>name</name>
- <cstring>CategoryFilterDlg</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>211</width>
- <height>295</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Category Filter</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="1" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout4</cstring>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="1" >
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>btnOK</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&amp;OK</string>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>btnCancel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&amp;Cancel</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget row="0" column="0" >
- <class>QGroupBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>GroupBox1</cstring>
- </property>
- <property stdset="1">
- <name>title</name>
- <string>Select groups to show</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="0" >
- <class>QListBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lstCategories</cstring>
- </property>
- <property stdset="1">
- <name>selectionMode</name>
- <enum>Multi</enum>
- </property>
- </widget>
- </grid>
- </widget>
- </grid>
-</widget>
-<connections>
- <connection>
- <sender>btnCancel</sender>
- <signal>clicked()</signal>
- <receiver>CategoryFilterDlg</receiver>
- <slot>reject()</slot>
- </connection>
- <connection>
- <sender>btnOK</sender>
- <signal>clicked()</signal>
- <receiver>CategoryFilterDlg</receiver>
- <slot>accept()</slot>
- </connection>
-</connections>
-<tabstops>
- <tabstop>lstCategories</tabstop>
- <tabstop>btnCancel</tabstop>
- <tabstop>btnOK</tabstop>
-</tabstops>
-</UI>
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp
index 0746da6..e8ce7e7 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.cpp
+++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp
@@ -11,39 +11,59 @@
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <iostream>
using namespace std;
-
+
+#include <qgroupbox.h>
+#include <qlayout.h>
#include <qlistbox.h>
#include <qstring.h>
#include "categoryfilterimpl.h"
CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name )
- : CategoryFilterDlg(parent,name, true)
+ : QDialog( parent, name, true )
{
+ setCaption( tr( "Category Filter" ) );
+
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->setMargin( 2 );
+ layout->setSpacing( 4 );
+
+ QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this );
+ grpbox->layout()->setSpacing( 2 );
+ grpbox->layout()->setMargin( 4 );
+ layout->addWidget( grpbox );
+
+ QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
+
+ lstCategories = new QListBox( grpbox );
+ lstCategories->setSelectionMode( QListBox::Multi );
+ grplayout->addWidget( lstCategories );
+
// Split up categories and add them to the listbox
int start = 1;
QString item;
int end;
+ QString finditem;
do
{
end = categories.find( "#", start );
item = categories.mid( start, end - start );
if ( item != "" )
{
lstCategories->insertItem( item );
-
- if ( selectedCategories.find( "#" + item + "#" ) != -1 )
+ finditem = QString( "#%1#" ).arg( item );
+ if ( selectedCategories.find( finditem ) != -1 )
lstCategories->setSelected( lstCategories->count()-1, true );
}
start = end + 1;
} while ( start < (int)categories.length() );
lstCategories->sort( true );
@@ -57,15 +77,18 @@ CategoryFilterImpl :: ~CategoryFilterImpl()
QString CategoryFilterImpl :: getSelectedFilter()
{
// Grab cetegories from listbox
QString ret = "#";
for ( int i = 0 ; i < (int)lstCategories->count() ; ++i )
{
if ( lstCategories->isSelected( i ) )
- ret += lstCategories->text( i ) + "#";
+ {
+ ret.append( lstCategories->text( i ) );
+ ret.append( "#" );
+ }
}
if ( ret == "#" )
ret = "";
return ret;
}
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.h b/noncore/settings/aqpkg/categoryfilterimpl.h
index b6b4fd5..a85fce4 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.h
+++ b/noncore/settings/aqpkg/categoryfilterimpl.h
@@ -13,28 +13,31 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef CATEGORYFILTERIMPL_H
#define CATEGORYFILTERIMPL_H
-#include <qwidget.h>
-#include <qstring.h>
+#include <qdialog.h>
-#include "categoryfilter.h"
+class QListBox;
/**
*@author Andy Qua
*/
-class CategoryFilterImpl : public CategoryFilterDlg
+class CategoryFilterImpl : public QDialog
{
Q_OBJECT
public:
CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent=0, const char *name=0);
~CategoryFilterImpl();
QString getSelectedFilter();
+
+private:
+ QListBox *lstCategories;
+
};
#endif
diff --git a/noncore/settings/aqpkg/instoptions.ui b/noncore/settings/aqpkg/instoptions.ui
deleted file mode 100644
index 00eab1e..0000000
--- a/noncore/settings/aqpkg/instoptions.ui
+++ b/dev/null
@@ -1,167 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>InstallOptionsDlg</class>
-<widget>
- <class>QDialog</class>
- <property stdset="1">
- <name>name</name>
- <cstring>InstallOptionsDlg</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>283</width>
- <height>274</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Options</string>
- </property>
- <property stdset="1">
- <name>sizeGripEnabled</name>
- <bool>false</bool>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QGroupBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>GroupBox1</cstring>
- </property>
- <property stdset="1">
- <name>title</name>
- <string>Options</string>
- </property>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>forceDepends</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>12</x>
- <y>20</y>
- <width>110</width>
- <height>19</height>
- </rect>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Force Depends</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>forceReinstall</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>12</x>
- <y>45</y>
- <width>107</width>
- <height>19</height>
- </rect>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Force Reinstall</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>forceRemove</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>12</x>
- <y>70</y>
- <width>105</width>
- <height>19</height>
- </rect>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Force Remove</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>forceOverwrite</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>12</x>
- <y>95</y>
- <width>114</width>
- <height>19</height>
- </rect>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Force Overwrite</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>verboseWget</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>12</x>
- <y>120</y>
- <width>104</width>
- <height>19</height>
- </rect>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Verbose WGet</string>
- </property>
- </widget>
- </widget>
- <widget>
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>btnOK</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>OK</string>
- </property>
- </widget>
- </vbox>
-</widget>
-<connections>
- <connection>
- <sender>btnOK</sender>
- <signal>clicked()</signal>
- <receiver>InstallOptionsDlg</receiver>
- <slot>accept()</slot>
- </connection>
-</connections>
-</UI>
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp
index 3a37eec..47b250d 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.cpp
+++ b/noncore/settings/aqpkg/instoptionsimpl.cpp
@@ -14,26 +14,55 @@
* (at your option) any later version. *
* *
***************************************************************************/
#ifdef QWS
#include <qpe/config.h>
#endif
-#include <qdialog.h>
#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include "global.h"
#include "instoptionsimpl.h"
#include "ipkg.h"
-#include "global.h"
InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl )
- : InstallOptionsDlg( parent, name, modal, fl )
+ : QDialog( parent, name, modal, fl )
{
+ setCaption( tr( "Options" ) );
+
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->setMargin( 2 );
+ layout->setSpacing( 4 );
+
+ QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this );
+ grpbox->layout()->setSpacing( 2 );
+ grpbox->layout()->setMargin( 4 );
+ layout->addWidget( grpbox );
+
+ QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
+
+ forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox );
+ grplayout->addWidget( forceDepends );
+
+ forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox );
+ grplayout->addWidget( forceReinstall );
+
+ forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox );
+ grplayout->addWidget( forceRemove );
+
+ forceOverwrite = new QCheckBox( tr( "Force Overwrite" ), grpbox );
+ grplayout->addWidget( forceOverwrite );
+
+ verboseWget = new QCheckBox( tr( "Verbose WGet" ), grpbox );
+ grplayout->addWidget( verboseWget );
+
if ( flags & FORCE_DEPENDS )
forceDepends->setChecked( true );
if ( flags & FORCE_REINSTALL )
forceReinstall->setChecked( true );
if ( flags & FORCE_REMOVE )
forceRemove->setChecked( true );
if ( flags & FORCE_OVERWRITE )
forceOverwrite->setChecked( true );
@@ -62,9 +91,9 @@ int InstallOptionsDlgImpl :: getFlags()
if ( forceRemove->isChecked() )
flags |= FORCE_REMOVE;
if ( forceOverwrite->isChecked() )
flags |= FORCE_OVERWRITE;
if ( verboseWget->isChecked() )
flags |= VERBOSE_WGET;
return flags;
-} \ No newline at end of file
+}
diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h
index 893f9bb..f4724a0 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.h
+++ b/noncore/settings/aqpkg/instoptionsimpl.h
@@ -12,23 +12,29 @@
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef INSTALLOPTIONSIMPL_H
#define INSTALLOPTIONSIMPL_H
-#include "instoptions.h"
+#include <qdialog.h>
-class InstallOptionsDlgImpl : public InstallOptionsDlg
+class QCheckBox;
+
+class InstallOptionsDlgImpl : public QDialog
{
+ Q_OBJECT
public:
InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
~InstallOptionsDlgImpl();
int getFlags();
-protected:
-
private:
+ QCheckBox* forceDepends;
+ QCheckBox* forceReinstall;
+ QCheckBox* forceRemove;
+ QCheckBox* forceOverwrite;
+ QCheckBox* verboseWget;
};
#endif