summaryrefslogtreecommitdiff
authordrw <drw>2003-02-04 23:38:30 (UTC)
committer drw <drw>2003-02-04 23:38:30 (UTC)
commit97b96e141fca844317e59ca5b99c1bf5fa52b1f0 (patch) (side-by-side diff)
treecb2d505a72747fef0d2c99debab7c4c9fedd0553
parent294f0a9b5e5678a6eba1fb77943201fac804049f (diff)
downloadopie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.zip
opie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.tar.gz
opie-97b96e141fca844317e59ca5b99c1bf5fa52b1f0.tar.bz2
More dialog clean-up. Except for QWhatsThis, the UI changes are pretty much done now for AQPkg
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
@@ -23,26 +23,25 @@ SOURCES = mainwin.cpp \
main.cpp \
package.cpp \
installdlgimpl.cpp \
instoptionsimpl.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 \
../../../i18n/en/aqpkg.ts \
../../../i18n/es/aqpkg.ts \
../../../i18n/fr/aqpkg.ts \
../../../i18n/hu/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
@@ -7,65 +7,88 @@
***************************************************************************/
/***************************************************************************
* *
* 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 );
showMaximized();
}
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
@@ -9,32 +9,35 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#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
@@ -10,34 +10,63 @@
* *
* 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. *
* *
***************************************************************************/
#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 );
if ( flags & VERBOSE_WGET )
verboseWget->setChecked( true );
// if ( flags & MAKE_LINKS )
// makeLinks->setChecked( true );
@@ -58,13 +87,13 @@ int InstallOptionsDlgImpl :: getFlags()
if ( forceDepends->isChecked() )
flags |= FORCE_DEPENDS;
if ( forceReinstall->isChecked() )
flags |= FORCE_REINSTALL;
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
@@ -8,27 +8,33 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#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