summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp2
-rw-r--r--core/apps/textedit/textedit.cpp2
-rw-r--r--core/opie-login/loginwindowimpl.cpp4
-rw-r--r--freetype/fontfactoryttf_qws.h2
-rw-r--r--libopie2/opieui/oseparator.cpp2
-rw-r--r--libopie2/qt3/opieui/oeditlistbox.h2
-rw-r--r--libopie2/qt3/opieui/ojanuswidget.cpp2
-rw-r--r--library/lightstyle.cpp10
-rw-r--r--library/lightstyle.h2
-rw-r--r--library/qpeapplication.cpp4
-rw-r--r--library/qpestyle.cpp4
-rw-r--r--library/qpestyle.h2
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp4
-rw-r--r--noncore/apps/tinykate/libkate/qt3back/qregexp3.h4
-rw-r--r--noncore/apps/zsafe/shadedlistitem.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp6
-rw-r--r--noncore/settings/appearance2/appearance.cpp4
-rw-r--r--noncore/settings/doctab/doctab.cpp2
-rw-r--r--noncore/settings/language/language.cpp2
-rw-r--r--noncore/settings/networksettings/interfaces/module.h2
-rw-r--r--noncore/settings/networksettings/mainwindow/addconnectionimp.cpp2
-rw-r--r--noncore/settings/networksettings/mainwindow/mainwindowimp.cpp2
-rw-r--r--noncore/unsupported/qpdf/QOutputDev.cpp2
-rw-r--r--scripts/kconfig/qconf.cc16
-rw-r--r--scripts/kconfig/qconf.h2
26 files changed, 45 insertions, 45 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index 5171bf1..bee58e7 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -208,97 +208,97 @@ static QChar vt100extended(QChar c)
case 0x2424 : return 9;
case 0x240b : return 10;
case 0x2518 : return 11;
case 0x2510 : return 12;
case 0x250c : return 13;
case 0x2514 : return 14;
case 0x253c : return 15;
case 0xf800 : return 16;
case 0xf801 : return 17;
case 0x2500 : return 18;
case 0xf803 : return 19;
case 0xf804 : return 20;
case 0x251c : return 21;
case 0x2524 : return 22;
case 0x2534 : return 23;
case 0x252c : return 24;
case 0x2502 : return 25;
case 0x2264 : return 26;
case 0x2265 : return 27;
case 0x03c0 : return 28;
case 0x2260 : return 29;
case 0x00a3 : return 30;
case 0x00b7 : return 31;
}
return c;
}
static QChar identicalMap(QChar c)
{
return c;
}
void TEWidget::fontChange(const QFont &)
{
QFontMetrics fm(font());
font_h = fm.height();
// font_w = fm.maxWidth();
font_w = fm.width("m");
font_a = fm.ascent();
printf("font h=%d max_width=%d width_m=%d assent=%d\n", font_h,
fm.maxWidth(), font_w, font_a);
//printf("font_h: %d\n",font_h);
//printf("font_w: %d\n",font_w);
//printf("font_a: %d\n",font_a);
//printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii());
//printf("rawname: %s\n",font().rawName().ascii());
fontMap =
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646")
? vt100extended
:
#endif
identicalMap;
propagateSize();
update();
}
void TEWidget::setVTFont(const QFont& f)
{
QFrame::setFont(f);
}
QFont TEWidget::getVTFont() {
return font();
}
void TEWidget::setFont(const QFont &)
{
// ignore font change request if not coming from konsole itself
}
/* ------------------------------------------------------------------------- */
/* */
/* Constructor / Destructor */
/* */
/* ------------------------------------------------------------------------- */
TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
{
#ifndef QT_NO_CLIPBOARD
cb = QApplication::clipboard();
QObject::connect( (QObject*)cb, SIGNAL(dataChanged()),
this, SLOT(onClearSelection()) );
#endif
scrollbar = new QScrollBar(this);
scrollbar->setCursor( arrowCursor );
connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
hScrollbar = new QScrollBar(this);
hScrollbar->setCursor( arrowCursor );
hScrollbar->setOrientation(QScrollBar::Horizontal);
// hScrollbar->setMaximumHeight(16);
connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int)));
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index cabeb20..c7273c5 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -1,96 +1,96 @@
/**********************************************************************
// textedit.cpp
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
**********************************************************************/
// changes added by L. J. Potter Sun 02-17-2002 21:31:31
#include "textedit.h"
#include "filePermissions.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/ofileselector.h>
#include <opie2/ofiledialog.h>
#include <opie2/ofontselector.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
/* QT */
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qtextstream.h>
#include <qclipboard.h>
#include <qaction.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qlayout.h>
#include <qtimer.h>
#include <qdir.h>
/* STD */
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h> //getenv
using namespace Opie::Core;
using namespace Opie::Ui;
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
class QpeEditor : public QMultiLineEdit
{
public:
QpeEditor( QWidget *parent, const char * name = 0 )
: QMultiLineEdit( parent, name ) {
clearTableFlags();
setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar );
}
void find( const QString &txt, bool caseSensitive,
bool backwards );
protected:
bool markIt;
int line1, line2, col1, col2;
void mousePressEvent( QMouseEvent * );
void mouseReleaseEvent( QMouseEvent * );
//public slots:
/*
signals:
void notFound();
void searchWrapped();
*/
private:
};
void QpeEditor::mousePressEvent( QMouseEvent *e ) {
switch(e->button()) {
case RightButton:
{ //rediculous workaround for qt popup menu
//and the hold right click mechanism
this->setSelection( line1, col1, line2, col2);
QMultiLineEdit::mousePressEvent( e );
markIt = false;
}
break;
default:
{
if(!markIt) {
int line, col;
this->getCursorPosition(&line, &col);
line1=line2=line;
col1=col2=col;
}
QMultiLineEdit::mousePressEvent( e );
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp
index 73c2cbe..ac24894 100644
--- a/core/opie-login/loginwindowimpl.cpp
+++ b/core/opie-login/loginwindowimpl.cpp
@@ -1,84 +1,84 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qpe/version.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qtimer.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#include <qgfx_qws.h>
#endif
#include <qwindowsystem_qws.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
#include <opie2/odevice.h>
#include <stdio.h>
#include <stdlib.h>
#include "passworddialogimpl.h"
#include "loginwindowimpl.h"
#include "loginapplication.h"
#include "inputmethods.h"
using namespace Opie::Core;
LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose )
{
QPopupMenu *pop = new QPopupMenu ( this );
pop-> insertItem ( tr( "Restart" ), this, SLOT( restart()));
pop-> insertItem ( tr( "Quit" ), this, SLOT( quit()));
m_menu-> setPopup ( pop );
QCopChannel *channel = new QCopChannel ( "QPE/TaskBar", this );
connect ( channel, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( receive(const QCString&,const QByteArray&)));
QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 );
m_input = new InputMethods ( m_taskbar );
connect ( m_input, SIGNAL( inputToggled(bool)), this, SLOT( calcMaxWindowRect()));
lay-> addWidget ( m_input );
lay-> addStretch ( 10 );
setActiveWindow ( );
m_password-> setFocus ( );
m_user-> insertStringList ( lApp-> allUsers ( ));
//there is no point in displaying the IM for a zaurus
if (ODevice::inst ( )-> series ( ) != Model_Zaurus){
QTimer::singleShot ( 0, this, SLOT( showIM()));
}
QString opiedir = ::getenv ( "OPIEDIR" );
@@ -91,97 +91,97 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C
TextLabel2-> setBackgroundPixmap ( bgpix);
}
// m_caption-> setText ( tr("<center>Welcome to OPIE %1</center><center>& %2 %3</center>"). arg(QPE_VERSION). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( )));
Config cfg ( "opie-login" );
cfg. setGroup ( "General" );
QString last = cfg. readEntry ( "LastLogin" );
if ( !last. isEmpty ( ))
m_user-> setEditText ( last );
calcMaxWindowRect ( );
if ( PasswordDialogImpl::needDialog() )
QTimer::singleShot(10, this, SLOT(showPasswordDialog()) );
}
LoginWindowImpl::~LoginWindowImpl ( )
{
}
void LoginWindowImpl::receive ( const QCString &msg, const QByteArray &data )
{
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "hideInputMethod()" )
m_input-> hideInputMethod ( );
else if ( msg == "showInputMethod()" )
m_input-> showInputMethod ( );
else if ( msg == "reloadInputMethods()" )
m_input-> loadInputMethods ( );
}
void LoginWindowImpl::calcMaxWindowRect ( )
{
#ifdef Q_WS_QWS
QRect wr;
int displayWidth = qApp-> desktop ( )-> width ( );
QRect ir = m_input-> inputRect ( );
if ( ir.isValid() )
wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 );
else
wr.setCoords( 0, 0, displayWidth-1, m_taskbar->y()-1 );
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
wr = qt_screen-> mapToDevice ( wr, QSize ( qt_screen-> width ( ), qt_screen-> height ( )));
#endif
QWSServer::setMaxWindowRect( wr );
#endif
}
void LoginWindowImpl::keyPressEvent ( QKeyEvent *e )
{
switch ( e-> key ( )) {
case HardKey_Suspend: suspend ( );
break;
case HardKey_Backlight: backlight ( );
break;
default: e-> ignore ( );
break;
}
LoginWindow::keyPressEvent ( e );
}
void LoginWindowImpl::toggleEchoMode ( bool t )
{
m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password );
}
void LoginWindowImpl::showIM ( )
{
m_input-> showInputMethod ( );
}
void LoginWindowImpl::restart ( )
{
qApp-> quit ( );
}
void LoginWindowImpl::quit ( )
{
lApp-> quitToConsole ( );
}
void LoginWindowImpl::suspend ( )
{
ODevice::inst ( )-> suspend ( );
QCopEnvelope e("QPE/System", "setBacklight(int)");
e << -3; // Force on
diff --git a/freetype/fontfactoryttf_qws.h b/freetype/fontfactoryttf_qws.h
index 208ab61..ff0fcfc 100644
--- a/freetype/fontfactoryttf_qws.h
+++ b/freetype/fontfactoryttf_qws.h
@@ -1,63 +1,63 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef FONTFACTORY_FT_H
#define FONTFACTORY_FT_H
#include <qfontmanager_qws.h>
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
# include <private/qfontdata_p.h>
#else
# include "qfontdata_p.h"
#endif
#ifdef QT_NO_FREETYPE
extern "C" {
#include <freetype/freetype.h>
}
// ascent, descent, width(ch), width(string), maxwidth?
// leftbearing, rightbearing, minleftbearing,minrightbearing
// leading
class QFontFactoryFT : public QFontFactory {
public:
QFontFactoryFT();
virtual ~QFontFactoryFT();
QRenderedFont * get(const QFontDef &,QDiskFont *);
virtual void load(QDiskFont *) const;
virtual QString name();
private:
friend class QRenderedFontFT;
FT_Library library;
};
#endif // QT_NO_FREETYPE
#endif // QFONTFACTORY_FT_H
diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp
index bbc4381..177368b 100644
--- a/libopie2/opieui/oseparator.cpp
+++ b/libopie2/opieui/oseparator.cpp
@@ -63,67 +63,67 @@ void OSeparator::setOrientation(int orientation)
{
switch(orientation)
{
case Vertical:
case VLine:
setFrameStyle( QFrame::VLine | QFrame::Sunken );
setMinimumSize(2, 0);
break;
default:
owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl;
case Horizontal:
case HLine:
setFrameStyle( QFrame::HLine | QFrame::Sunken );
setMinimumSize(0, 2);
break;
}
}
int OSeparator::orientation() const
{
if ( frameStyle() & VLine )
return VLine;
if ( frameStyle() & HLine )
return HLine;
return 0;
}
void OSeparator::drawFrame(QPainter *p)
{
QPoint p1, p2;
QRect r = frameRect();
const QColorGroup & g = colorGroup();
if ( frameStyle() & HLine ) {
p1 = QPoint( r.x(), r.height()/2 );
p2 = QPoint( r.x()+r.width(), p1.y() );
}
else {
p1 = QPoint( r.x()+r.width()/2, 0 );
p2 = QPoint( p1.x(), r.height() );
}
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() );
#else
QStyleOption opt( lineWidth(), midLineWidth() );
style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt );
#endif
}
QSize OSeparator::sizeHint() const
{
if ( frameStyle() & VLine )
return QSize(2, 0);
if ( frameStyle() & HLine )
return QSize(0, 2);
return QSize(-1, -1);
}
diff --git a/libopie2/qt3/opieui/oeditlistbox.h b/libopie2/qt3/opieui/oeditlistbox.h
index 63fab11..c9c207d 100644
--- a/libopie2/qt3/opieui/oeditlistbox.h
+++ b/libopie2/qt3/opieui/oeditlistbox.h
@@ -1,78 +1,78 @@
/* This file is part of the KDE libraries
Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OEDITLISTBOX_H
#define OEDITLISTBOX_H
#include <qgroupbox.h>
#include <qlistbox.h>
class OLineEdit;
class OComboBox;
class QPushButton;
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
enum StringComparisonMode {
CaseSensitive = 0x00001, // 0 0001
BeginsWith = 0x00002, // 0 0010
EndsWith = 0x00004, // 0 0100
Contains = 0x00008, // 0 1000
ExactMatch = 0x00010 // 1 0000
};
#endif
class OEditListBoxPrivate;
/**
* An editable listbox
*
* This class provides a editable listbox ;-), this means
* a listbox which is accompanied by a line edit to enter new
* items into the listbox and pushbuttons to add and remove
* items from the listbox and two buttons to move items up and down.
*/
class OEditListBox : public QGroupBox
{
Q_OBJECT
public:
/// @since 3.1
class CustomEditor
{
public:
CustomEditor()
: m_representationWidget( 0L ),
m_lineEdit( 0L ) {}
CustomEditor( QWidget *repWidget, OLineEdit *edit )
: m_representationWidget( repWidget ),
m_lineEdit( edit ) {}
CustomEditor( OComboBox *combo );
void setRepresentationWidget( QWidget *repWidget ) {
m_representationWidget = repWidget;
}
void setLineEdit( OLineEdit *edit ) {
m_lineEdit = edit;
}
virtual QWidget *representationWidget() const {
return m_representationWidget;
}
virtual OLineEdit *lineEdit() const {
return m_lineEdit;
}
diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp
index 063e393..8bdbc03 100644
--- a/libopie2/qt3/opieui/ojanuswidget.cpp
+++ b/libopie2/qt3/opieui/ojanuswidget.cpp
@@ -727,97 +727,97 @@ void OJanusWidget::slotFontChanged()
mIconList->invalidateWidth();
}
}
// makes the treelist behave like the list of kcontrol
void OJanusWidget::slotItemClicked(QListViewItem *it)
{
if(it && (it->childCount()>0))
it->setOpen(!it->isOpen());
}
void OJanusWidget::setFocus()
{
if( mValid == false ) { return; }
if( mFace == TreeList )
{
mTreeList->setFocus();
}
if( mFace == IconList )
{
mIconList->setFocus();
}
else if( mFace == Tabbed )
{
mTabControl->setFocus();
}
else if( mFace == Swallow )
{
mSwallowPage->setFocus();
}
else if( mFace == Plain )
{
mPlainPage->setFocus();
}
}
QSize OJanusWidget::minimumSizeHint() const
{
if( mFace == TreeList || mFace == IconList )
{
QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 );
QSize s2(0,0);
QSize s3(0,0);
QSize s4( mPageStack->sizeHint() );
if( mFace == TreeList )
{
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
s1.rwidth() += style().splitterWidth();
#else
s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth );
#endif
s2 = mTreeList->minimumSize();
}
else
{
mIconList->updateMinimumHeight();
mIconList->updateWidth();
s2 = mIconList->minimumSize();
}
if( mTitleLabel->isVisible() == true )
{
s3 += mTitleLabel->sizeHint();
s3.rheight() += mTitleSep->minimumSize().height();
}
//
// Select the tallest item. It has only effect in IconList mode
//
int h1 = s1.rheight() + s3.rheight() + s4.height();
int h2 = QMAX( h1, s2.rheight() );
return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) );
}
else if( mFace == Tabbed )
{
return( mTabControl->sizeHint() );
}
else if( mFace == Swallow )
{
return( mSwallowPage->minimumSize() );
}
else if( mFace == Plain )
{
return( mPlainPage->sizeHint() );
}
else
{
return( QSize( 100, 100 ) ); // Should never happen though.
}
}
QSize OJanusWidget::sizeHint() const
diff --git a/library/lightstyle.cpp b/library/lightstyle.cpp
index f18bdca..3bd1623 100644
--- a/library/lightstyle.cpp
+++ b/library/lightstyle.cpp
@@ -1,70 +1,70 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "lightstyle.h"
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#define INCLUDE_MENUITEM_DEF
#include "qmenubar.h"
#include "qapplication.h"
#include "qpainter.h"
#include "qpalette.h"
#include "qframe.h"
#include "qpushbutton.h"
#include "qdrawutil.h"
#include "qscrollbar.h"
#include "qtabbar.h"
#include "qguardedptr.h"
#include "qlayout.h"
#include "qlineedit.h"
class LightStylePrivate
{
public:
LightStylePrivate()
: hoverWidget(0), ref(1), savePalette(0)
{
}
QGuardedPtr<QWidget> hoverWidget;
QPalette oldPalette, hoverPalette;
int ref;
QPoint mousePos;
QPalette *savePalette;
};
static LightStylePrivate *singleton = 0;
LightStyle::LightStyle()
: QWindowsStyle()
{
if (! singleton) {
singleton = new LightStylePrivate;
QPalette pal = QApplication::palette();
singleton->oldPalette = pal;
QColor bg = pal.color(QPalette::Active, QColorGroup::Background);
QColor prelight;
if ( (bg.red() + bg.green() + bg.blue()) / 3 > 128)
@@ -114,114 +114,114 @@ QSize LightStyle::scrollBarExtent() const
int LightStyle::buttonDefaultIndicatorWidth() const
{
return 2;
}
int LightStyle::sliderThickness() const
{
return 16;
}
int LightStyle::sliderLength() const
{
return 13;
}
int LightStyle::buttonMargin() const
{
return 4;
}
QSize LightStyle::exclusiveIndicatorSize() const
{
return QSize(13, 13);
}
int LightStyle::defaultFrameWidth() const
{
return 2;
}
QSize LightStyle::indicatorSize() const
{
return QSize(13, 13);
}
void LightStyle::polish(QWidget *widget)
{
if (widget->inherits("QPushButton"))
widget->installEventFilter(this);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (widget->inherits("QLineEdit")) {
QLineEdit *lineedit = (QLineEdit *) widget;
lineedit->setFrameShape(QFrame::StyledPanel);
lineedit->setLineWidth(2);
}
#endif
QWindowsStyle::polish(widget);
}
void LightStyle::unPolish(QWidget *widget)
{
if (widget->inherits("QPushButton"))
widget->removeEventFilter(this);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (widget->inherits("QLineEdit")) {
QLineEdit *lineedit = (QLineEdit *) widget;
lineedit->setLineWidth(1);
lineedit->setFrameShape(QFrame::WinPanel);
}
#endif
QWindowsStyle::unPolish(widget);
}
void LightStyle::polish(QApplication *app)
{
QPalette pal = app->palette();
QColorGroup active(pal.color(QPalette::Active,
QColorGroup::Foreground), // foreground
pal.color(QPalette::Active,
QColorGroup::Button), // button
pal.color(QPalette::Active,
QColorGroup::Background).light(), // light
pal.color(QPalette::Active,
QColorGroup::Background).dark(175), // dark
pal.color(QPalette::Active,
QColorGroup::Background).dark(110), // mid
pal.color(QPalette::Active,
QColorGroup::Text), // text
pal.color(QPalette::Active,
QColorGroup::BrightText), // bright text
pal.color(QPalette::Active,
QColorGroup::Base), // base
pal.color(QPalette::Active,
QColorGroup::Background)), // background
disabled(pal.color(QPalette::Disabled,
QColorGroup::Foreground), // foreground
pal.color(QPalette::Disabled,
QColorGroup::Button), // button
pal.color(QPalette::Disabled,
QColorGroup::Background).light(), // light
pal.color(QPalette::Disabled,
QColorGroup::Background).dark(), // dark
pal.color(QPalette::Disabled,
QColorGroup::Background).dark(110), // mid
pal.color(QPalette::Disabled,
QColorGroup::Text), // text
pal.color(QPalette::Disabled,
@@ -369,114 +369,114 @@ void LightStyle::drawButton(QPainter *p, int x, int y, int w, int h,
p->drawLine(x + 1, y + 2, x + 1, y + h - 3); // left
p->drawLine(x + 2, y + 1, x + w - 3, y + 1); // top
if (sunken)
p->setPen(g.light());
else
p->setPen(g.mid());
p->drawLine(x + w - 2, y + 2, x + w - 2, y + h - 3); // right + 1
p->drawLine(x + 2, y + h - 2, x + w - 3, y + h - 2); // bottom + 1
p->restore();
}
void LightStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g,
bool sunken, const QBrush *fill)
{
drawButton(p, x, y, w, h, g, sunken, fill);
}
void LightStyle::getButtonShift(int &x, int &y) const
{
x = y = 0;
}
void LightStyle::drawComboButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool,
bool editable, bool,
const QBrush *fill)
{
drawButton(p, x, y, w, h, g, FALSE, fill);
if (editable) {
QRect r = comboButtonRect(x, y, w, h);
qDrawShadePanel(p, r.x() - 1, r.y() - 1,
r.width() + defaultFrameWidth(),
r.height() + defaultFrameWidth(),
g, TRUE);
}
int indent = ((y + h) / 2) - 3;
int xpos = x;
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if( QApplication::reverseLayout() )
xpos += indent;
else
#endif
xpos += w - indent - 5;
drawArrow(p, Qt::DownArrow, TRUE, xpos, indent, 5, 5, g, TRUE, fill);
}
QRect LightStyle::comboButtonRect( int x, int y, int w, int h ) const
{
QRect r(x + 3, y + 3, w - 6, h - 6);
int indent = ((y + h) / 2) - 3;
r.setRight(r.right() - indent - 10);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if( QApplication::reverseLayout() )
r.moveBy( indent + 10, 0 );
#endif
return r;
}
QRect LightStyle::comboButtonFocusRect(int x, int y, int w, int h ) const
{
return comboButtonRect(x, y, w, h);
}
void LightStyle::drawPanel(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
int lw, const QBrush *fill)
{
if (lw >= 2) {
if ( fill )
p->fillRect(x + 2, y + 2, w - 4, h - 4, *fill);
QPen oldpen = p->pen();
// frame
p->setPen(g.dark());
p->drawLine(x, y + 2, x, y + h - 3); // left
p->drawLine(x + 2, y, x + w - 3, y); // top
p->drawLine(x + w - 1, y + 2, x + w - 1, y + h - 3); // right
p->drawLine(x + 2, y + h - 1, x + w - 3, y + h - 1); // bottom
p->drawPoint(x + 1, y + 1);
p->drawPoint(x + 1, y + h - 2);
p->drawPoint(x + w - 2, y + 1);
p->drawPoint(x + w - 2, y + h - 2);
// bevel
if (sunken)
p->setPen(g.mid());
else
p->setPen(g.light());
p->drawLine(x + 1, y + 2, x + 1, y + h - 3); // left
p->drawLine(x + 2, y + 1, x + w - 3, y + 1); // top
if (sunken)
p->setPen(g.light());
else
p->setPen(g.mid());
diff --git a/library/lightstyle.h b/library/lightstyle.h
index c377cc2..0392957 100644
--- a/library/lightstyle.h
+++ b/library/lightstyle.h
@@ -1,77 +1,77 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef LIGHTSTYLE_H
#define LIGHTSTYLE_H
#ifndef QT_H
#include <qstyle.h>
#include <qwindowsstyle.h>
#endif // QT_H
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#ifdef QT_PLUGIN_STYLE_LIGHT
# define Q_EXPORT_STYLE_LIGHT
#else
# define Q_EXPORT_STYLE_LIGHT Q_EXPORT
#endif // QT_PLUGIN_STYLE_LIGHT
class Q_EXPORT_STYLE_LIGHT LightStyle : public QWindowsStyle
{
public:
LightStyle();
virtual ~LightStyle();
void polish(QWidget *widget);
void unPolish(QWidget*widget);
void polish(QApplication *app);
void unPolish(QApplication *app);
void polishPopupMenu(QPopupMenu *menu);
void drawPushButton(QPushButton *button, QPainter *p);
void drawButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
const QBrush *fill = 0);
void drawBevelButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
const QBrush *fill = 0);
void getButtonShift(int &x, int &y) const;
void drawComboButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
bool editable = FALSE, bool = TRUE,
const QBrush *fill = 0);
QRect comboButtonRect(int x, int y, int w, int h) const;
QRect comboButtonFocusRect(int x, int y, int w, int h) const;
void drawIndicator(QPainter *p, int x, int y ,int w, int h,
const QColorGroup &g, int state,
bool = FALSE, bool = TRUE);
QSize indicatorSize() const;
void drawExclusiveIndicator(QPainter *p, int x, int y ,int w, int h,
const QColorGroup &g, bool on,
bool = FALSE, bool = TRUE);
QSize exclusiveIndicatorSize() const;
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index af00f49..1c5ced3 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -15,97 +15,97 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
*/
#define QTOPIA_INTERNAL_LANGLIST
#include <stdlib.h>
#include <unistd.h>
#ifndef Q_OS_MACX
#include <linux/limits.h> // needed for some toolchains (PATH_MAX)
#endif
#include <qfile.h>
#include <qqueue.h>
#ifdef Q_WS_QWS
#ifndef QT_NO_COP
#if QT_VERSION <= 231
#define private public
#define sendLocally processEvent
#include "qcopenvelope_qws.h"
#undef private
#else
#include "qcopenvelope_qws.h"
#endif
#endif
#include <qwindowsystem_qws.h>
#endif
#include <qtextstream.h>
#include <qpalette.h>
#include <qbuffer.h>
#include <qptrdict.h>
#include <qregexp.h>
#include <qdir.h>
#include <qlabel.h>
#include <qdialog.h>
#include <qdragobject.h>
#include <qtextcodec.h>
#include <qevent.h>
#include <qtooltip.h>
#include <qsignal.h>
#include <qmainwindow.h>
#include <qwidgetlist.h>
#include <qpixmapcache.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#define QTOPIA_INTERNAL_INITAPP
#include "qpeapplication.h"
#include "qpestyle.h"
#include "styleinterface.h"
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qstylefactory.h>
#else
#include <qplatinumstyle.h>
#include <qwindowsstyle.h>
#include <qmotifstyle.h>
#include <qmotifplusstyle.h>
#include "lightstyle.h"
#include <qpe/qlibrary.h>
#endif
#include "global.h"
#include "resource.h"
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
#include "qutfcodec.h"
#endif
#include "config.h"
#include "network.h"
#ifdef QWS
#include "fontmanager.h"
#include "fontdatabase.h"
#endif
#include "alarmserver.h"
#include "applnk.h"
#include "qpemenubar.h"
#include "textcodecinterface.h"
#include "imagecodecinterface.h"
#include <qtopia/qpeglobal.h>
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#ifndef QT_NO_SOUND
#include <sys/soundcard.h>
#endif
#include "qt_override_p.h"
#include <backend/rohfeedback.h>
static bool useBigPixmaps = 0;
class HackWidget : public QWidget
{
public:
bool needsOk()
{ return (getWState() & WState_Reserved1 ); }
@@ -1798,97 +1798,97 @@ void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize )
\sa showMainWidget()
*/
void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize )
{
if ( mw && argc() == 2 )
Global::setDocument( mw, QString::fromUtf8(argv()[1]) );
// setMainWidget(mw); see above
d->show(mw, nomaximize );
}
/*!
If an application is started via a \link qcop.html QCop\endlink
message, the application will process the \link qcop.html
QCop\endlink message and then quit. If the application calls this
function while processing a \link qcop.html QCop\endlink message,
after processing its outstanding \link qcop.html QCop\endlink
messages the application will start 'properly' and show itself.
\sa keepRunning()
*/
void QPEApplication::setKeepRunning()
{
if ( qApp && qApp->inherits( "QPEApplication" ) ) {
QPEApplication * qpeApp = ( QPEApplication* ) qApp;
qpeApp->d->keep_running = TRUE;
}
}
/*!
Returns TRUE if the application will quit after processing the
current list of qcop messages; otherwise returns FALSE.
\sa setKeepRunning()
*/
bool QPEApplication::keepRunning() const
{
return d->keep_running;
}
/*!
\internal
*/
void QPEApplication::internalSetStyle( const QString &style )
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if ( style == "QPE" ) {
setStyle( new QPEStyle );
}
else {
QStyle *s = QStyleFactory::create( style );
if ( s )
setStyle( s );
}
#else
if ( style == "Windows" ) {
setStyle( new QWindowsStyle );
}
else if ( style == "QPE" ) {
setStyle( new QPEStyle );
}
else if ( style == "Light" ) {
setStyle( new LightStyle );
}
#ifndef QT_NO_STYLE_PLATINUM
else if ( style == "Platinum" ) {
setStyle( new QPlatinumStyle );
}
#endif
#ifndef QT_NO_STYLE_MOTIF
else if ( style == "Motif" ) {
setStyle( new QMotifStyle );
}
#endif
#ifndef QT_NO_STYLE_MOTIFPLUS
else if ( style == "MotifPlus" ) {
setStyle( new QMotifPlusStyle );
}
#endif
else {
QStyle *sty = 0;
QString path = QPEApplication::qpeDir ( ) + "plugins/styles/";
#ifdef Q_OS_MACX
if ( style. find ( ".dylib" ) > 0 )
path += style;
else
path = path + "lib" + style. lower ( ) + ".dylib"; // compatibility
#else
if ( style. find ( ".so" ) > 0 )
path += style;
else
path = path + "lib" + style. lower ( ) + ".so"; // compatibility
diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp
index b61ada4..0566f6b 100644
--- a/library/qpestyle.cpp
+++ b/library/qpestyle.cpp
@@ -1,74 +1,74 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qpestyle.h"
#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qdrawutil.h>
#include <qcombobox.h>
#include <qtabbar.h>
QPEStyle::QPEStyle()
{
}
QPEStyle::~QPEStyle()
{
}
void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r,
const QColorGroup &cg, SFlags flags, const QStyleOption &data) const
{
switch ( pe ) {
case PE_ButtonTool:
{
QColorGroup mycg = cg;
if ( flags & Style_On ) {
QBrush fill( cg.mid(), Dense4Pattern );
mycg.setBrush( QColorGroup::Button, fill );
}
drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data );
break;
}
case PE_ButtonCommand:
case PE_ButtonDefault:
case PE_ButtonBevel:
case PE_HeaderSection:
{
QPen oldPen = p->pen();
p->fillRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2, cg.brush(QColorGroup::Button) );
int x2 = r.right();
int y2 = r.bottom();
if ( flags & (Style_Sunken | Style_Down | Style_On) )
p->setPen( cg.dark() );
else
p->setPen( cg.light() );
p->drawLine( r.x(), r.y()+1, r.x(), y2-1 );
p->drawLine( r.x()+1, r.y(), x2-1, r.y() );
if ( flags & (Style_Sunken | Style_Down | Style_On) )
p->setPen( cg.light() );
else
@@ -384,97 +384,97 @@ int QPEStyle::pixelMetric( PixelMetric metric, const QWidget *widget ) const
break;
case PM_SliderLength:
ret = 12;
break;
default:
ret = QWindowsStyle::pixelMetric( metric, widget );
break;
}
return ret;
}
QSize QPEStyle::sizeFromContents( ContentsType contents, const QWidget *widget,
const QSize &contentsSize, const QStyleOption &data) const
{
QSize sz(contentsSize);
switch ( contents ) {
case CT_PopupMenuItem:
{
if ( !widget || data.isDefault() )
break;
sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data );
sz = QSize( sz.width(), sz.height()-2 );
break;
}
default:
sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data );
break;
}
return sz;
}
#else
#include <qfontmetrics.h>
#include <qpalette.h>
#include <qdrawutil.h>
#include <qscrollbar.h>
#include <qbutton.h>
#include <qframe.h>
#include <qtabbar.h>
#define INCLUDE_MENUITEM_DEF
#include <qmenudata.h>
QPEStyle::QPEStyle()
{
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
setButtonMargin(buttonMargin());
setScrollBarExtent(scrollBarExtent().width(),scrollBarExtent().height());
#endif
}
QPEStyle::~QPEStyle()
{
}
int QPEStyle::buttonMargin() const
{
return 2;
}
QSize QPEStyle::scrollBarExtent() const
{
return QSize(13,13);
}
void QPEStyle::polish ( QPalette & )
{
}
void QPEStyle::polish( QWidget *w )
{
if ( w->inherits( "QListBox" ) ||
w->inherits( "QListView" ) ||
w->inherits( "QPopupMenu" ) ||
w->inherits( "QSpinBox" ) ) {
QFrame *f = (QFrame *)w;
f->setFrameShape( QFrame::StyledPanel );
f->setLineWidth( 1 );
}
}
void QPEStyle::unPolish( QWidget *w )
{
if ( w->inherits( "QListBox" ) ||
w->inherits( "QListView" ) ||
w->inherits( "QPopupMenu" ) ||
w->inherits( "QSpinBox" ) ) {
QFrame *f = (QFrame *)w;
f->setFrameShape( QFrame::StyledPanel );
f->setLineWidth( 2 );
}
}
int QPEStyle::defaultFrameWidth() const
diff --git a/library/qpestyle.h b/library/qpestyle.h
index 19ef346..1bde0ff 100644
--- a/library/qpestyle.h
+++ b/library/qpestyle.h
@@ -1,76 +1,76 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QPESTYLE_H
#define QPESTYLE_H
#ifndef QT_H
#include "qwindowsstyle.h"
#endif // QT_H
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
class Q_EXPORT QPEStyle : public QWindowsStyle
{
public:
QPEStyle();
virtual ~QPEStyle();
virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags=Style_Default, const QStyleOption & = QStyleOption::Default) const;
virtual void drawControl( ControlElement ce, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, const QStyleOption & = QStyleOption::Default) const;
virtual void drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, SCFlags sub=SC_All, SCFlags subActive=SC_None, const QStyleOption & = QStyleOption::Default) const;
virtual int pixelMetric( PixelMetric metric, const QWidget *widget=0 ) const;
virtual QSize sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize, const QStyleOption & = QStyleOption::Default) const;
};
#else
class Q_EXPORT QPEStyle : public QWindowsStyle
{
public:
QPEStyle();
virtual ~QPEStyle();
virtual void polish( QPalette &p );
virtual void polish( QWidget *w );
virtual void unPolish( QWidget *w );
int defaultFrameWidth () const;
void drawPanel ( QPainter * p, int x, int y, int w, int h,
const QColorGroup &, bool sunken=FALSE, int lineWidth = 1, const QBrush * fill = 0 );
void drawButton( QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken, const QBrush* fill );
void drawButtonMask ( QPainter * p, int x, int y, int w, int h );
void drawBevelButton( QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 );
QRect comboButtonRect( int x, int y, int w, int h);
QRect comboButtonFocusRect( int x, int y, int w, int h);
void drawComboButton( QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken, bool, bool enabled,
const QBrush *fill );
void drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h,
const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE );
void drawIndicator ( QPainter * p, int x, int y, int w, int h,
const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE );
void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&);
void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl );
ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p );
void drawRiffles( QPainter* p, int x, int y, int w, int h,
const QColorGroup &g, bool horizontal );
int sliderLength() const;
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp
index 98c1793..1199e4f 100644
--- a/noncore/apps/opie-console/TEWidget.cpp
+++ b/noncore/apps/opie-console/TEWidget.cpp
@@ -219,97 +219,97 @@ static QChar vt100extended(QChar c)
case 0x240d : return 5;
case 0x240a : return 6;
case 0x00b0 : return 7;
case 0x00b1 : return 8;
case 0x2424 : return 9;
case 0x240b : return 10;
case 0x2518 : return 11;
case 0x2510 : return 12;
case 0x250c : return 13;
case 0x2514 : return 14;
case 0x253c : return 15;
case 0xf800 : return 16;
case 0xf801 : return 17;
case 0x2500 : return 18;
case 0xf803 : return 19;
case 0xf804 : return 20;
case 0x251c : return 21;
case 0x2524 : return 22;
case 0x2534 : return 23;
case 0x252c : return 24;
case 0x2502 : return 25;
case 0x2264 : return 26;
case 0x2265 : return 27;
case 0x03c0 : return 28;
case 0x2260 : return 29;
case 0x00a3 : return 30;
case 0x00b7 : return 31;
}
return c;
}
static QChar identicalMap(QChar c)
{
return c;
}
void TEWidget::fontChange(const QFont &)
{
QFontMetrics fm(font());
font_h = fm.height();
font_w = fm.maxWidth();
font_a = fm.ascent();
//printf("font_h: %d\n",font_h);
//printf("font_w: %d\n",font_w);
//printf("font_a: %d\n",font_a);
//printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii());
//printf("rawname: %s\n",font().rawName().ascii());
fontMap =
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646")
? vt100extended
:
#endif
identicalMap;
propagateSize();
update();
}
void TEWidget::setVTFont(const QFont& f)
{
QFrame::setFont(f);
}
QFont TEWidget::getVTFont() {
return font();
}
void TEWidget::setFont(const QFont &)
{
// ignore font change request if not coming from konsole itself
}
/* ------------------------------------------------------------------------- */
/* */
/* Constructor / Destructor */
/* */
/* ----------------------------------------------------------------------- */
TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
{
#ifndef QT_NO_CLIPBOARD
cb = QApplication::clipboard();
QObject::connect( (QObject*)cb, SIGNAL(dataChanged()),
this, SLOT(onClearSelection()) );
#endif
scrollbar = new QScrollBar( this );
scrollbar->setCursor( arrowCursor );
connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
hscrollbar = new QScrollBar( Qt::Horizontal, this );
hscrollbar->setCursor( arrowCursor );
connect(hscrollbar, SIGNAL(valueChanged(int)), this, SLOT(hscrollChanged(int)));
diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
index 78635b2..7b30b1a 100644
--- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
+++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
@@ -1,89 +1,89 @@
/****************************************************************************
** $Id$
**
** Implementation of QRegExp class
**
** Created : 950126
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the tools module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
-#if QT_VERSION >=300
+#if QT_VERSION >= 0x030000
#error QRegExp3 is now in QT 3 use QRegExp instead
#endif
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#include "./qregexp3.h"
#else
#include "qregexp.h"
#endif
/* OPIE */
#include <opie2/odebug.h>
/* QT */
#include <qarray.h>
#include <qbitarray.h>
#include <qcache.h>
#include <qintdict.h>
#include <qmap.h>
#include <qstring.h>
#include <qtl.h>
#include <qvector.h>
/* STD */
#include <limits.h>
/*
WARNING! Be sure to read qregexp.tex before modifying this file.
*/
/*!
\class QRegExp3 qregexp.h
\brief The QRegExp class provides pattern matching using regular expressions.
\ingroup tools
\ingroup misc
\ingroup shared
Regular expressions, "regexps", provide a way to find patterns
within text. This is useful in many contexts, for example:
<ol>
<li>\e Validation. A regexp can be used to check whether a piece of
text meets some criteria, e.g. is an integer or contains no
whitespace.
<li>\e Searching. Regexps provide a much more powerful means of
searching text than simple string matching does. For example we can
create a regexp which says "find one of the words 'mail', 'letter'
or 'correspondence' but not any of the words 'email', 'mailman'
'mailer', 'letterbox' etc."
<li><em>Search and Replace.</em> A regexp can be used to replace a
diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.h b/noncore/apps/tinykate/libkate/qt3back/qregexp3.h
index 5b75131..fd6bc78 100644
--- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.h
+++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.h
@@ -1,111 +1,111 @@
/****************************************************************************
** $Id$
**
** Definition of QRegExp class
**
** Created : 950126
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the tools module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QREGEXP3_H
#define QREGEXP3_H
#ifndef QT_H
#include "qstringlist.h"
#endif // QT_H
-#if QT_VERSION >=300
+#if QT_VERSION >= 0x030000
#include <qregexp.h>
#else
class QRegExpEngine;
struct QRegExpPrivate;
class Q_EXPORT QRegExp3
{
public:
QRegExp3();
QRegExp3( const QString& pattern, bool caseSensitive = TRUE,
bool wildcard = FALSE );
QRegExp3( const QRegExp3& rx );
~QRegExp3();
QRegExp3& operator=( const QRegExp3& rx );
bool operator==( const QRegExp3& rx ) const;
bool operator!=( const QRegExp3& rx ) const { return !operator==( rx ); }
bool isEmpty() const;
bool isValid() const;
QString pattern() const;
void setPattern( const QString& pattern );
bool caseSensitive() const;
void setCaseSensitive( bool sensitive );
#ifndef QT_NO_REGEXP_WILDCARD
bool wildcard() const;
void setWildcard( bool wildcard );
#endif
bool minimal() const;
void setMinimal( bool minimal );
bool exactMatch( const QString& str );
bool exactMatch( const QString& str ) const;
#ifndef QT_NO_COMPAT
int match( const QString& str, int index, int *len = 0,
bool indexIsStart = TRUE );
#endif
int search( const QString& str, int start = 0 );
int search( const QString& str, int start = 0 ) const;
// QChar versions
#ifdef QCHAR_SUPPORT
int search(const QChar *str,int start=0);
int search(const QChar *str,int start=0) const;
int searchRev(const QChar *str,int start=-1);
int searchRev(const QChar *str,int start=-1) const ;
bool exactMatch(const QChar *str);
bool exactMatch(const QChar *str) const;
// end QChar versions
#endif
int searchRev( const QString& str, int start = -1 );
int searchRev( const QString& str, int start = -1 ) const;
int matchedLength();
#ifndef QT_NO_REGEXP_CAPTURE
QStringList capturedTexts();
QString cap( int nth = 0 );
int pos( int nth = 0 );
#endif
private:
void compile( bool caseSensitive );
QRegExpEngine *eng;
QRegExpPrivate *priv;
};
-#endif // QT_VERSION >= 300
+#endif // QT_VERSION >= 0x030000
#endif // QREGEXP_H
diff --git a/noncore/apps/zsafe/shadedlistitem.cpp b/noncore/apps/zsafe/shadedlistitem.cpp
index 72c6261..7f340f9 100644
--- a/noncore/apps/zsafe/shadedlistitem.cpp
+++ b/noncore/apps/zsafe/shadedlistitem.cpp
@@ -7,63 +7,63 @@
* 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 "zsafe.h"
#include "shadedlistitem.h"
ShadedListItem::ShadedListItem(int index, QListViewItem *parent)
: QListViewItem(parent)
{
oddRow = (index % 2 != 0);
}
ShadedListItem::ShadedListItem(int index, QListView *parent)
: QListViewItem(parent), lv(parent)
{
oddRow = (index % 2 != 0);
}
ShadedListItem::ShadedListItem(int index, QListView *parent, QListViewItem *after)
: QListViewItem(parent, after), lv(parent)
{
oddRow = (index % 2 != 0);
}
ShadedListItem::ShadedListItem(int index, QListView *parent, QString label1, QString label2, QString label3)
: QListViewItem(parent, label1, label2, label3), lv(parent)
{
oddRow = (index % 2 != 0);
}
ShadedListItem::ShadedListItem(int index, QListView *parent, QListViewItem *after, QString label1, QString label2, QString label3)
: QListViewItem(parent, after, label1, label2, label3), lv(parent)
{
oddRow = (index % 2 != 0);
}
ShadedListItem::~ShadedListItem()
{
}
void ShadedListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
{
QColorGroup colors(cg);
-#if QT_VERSION >=300
+#if QT_VERSION >= 0x030000
const QColorGroup::ColorRole crole = QColorGroup::Base;
// const QWidget::BackgroundMode bgmode = lv->viewport()->backgroundMode();
// const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode(bgmode);
#else
const QColorGroup::ColorRole crole = QColorGroup::Base;
#endif
if (oddRow) {
colors.setColor(crole, *ZSafe::oddRowColor);
}
else {
colors.setColor(crole, *ZSafe::evenRowColor);
}
QListViewItem::paintCell(p, colors, column, width, alignment);
}
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 1670f93..9ec5af9 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -327,152 +327,152 @@ void WellenreiterConfigWindow::performAction( const QString& type,
case 0: /* Ignore */ return;
case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return;
case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return;
case 3: /* Blink LED */ break; //FIXME: Implement this
case 4: /* Run Script */
{
/**
*
* Script Substitution Information:
*
* $SSID = SSID
* $MAC = MAC
* $WEP = Wep
* $CHAN = Channel
*
**/
script = script.replace( QRegExp( "$SSID" ), essid );
script = script.replace( QRegExp( "$MAC" ), mac );
script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) );
script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) );
odebug << "going to call script '" << script << "'" << oendl;
::system( script );
odebug << "script returned." << oendl;
return;
}
default: assert( false );
}
}
void WellenreiterConfigWindow::load()
{
#ifdef Q_WS_X11
#warning Persistent Configuration not yet implemented for standalone X11 build
performAutodetection();
#else
odebug << "loading configuration settings..." << oendl;
/* This is dumb monkey typing stuff... We _need_ to do this automatically! */
OConfig* c = oApp->config();
c->setGroup( "Interface" );
QString interface = c->readEntry( "name", "<none>" );
if ( interface != "<none>" )
{
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
interfaceName->insertItem( interface, 0 );
interfaceName->setCurrentItem( 0 );
#else
interfaceName->setCurrentText( interface );
#endif
QString device = c->readEntry( "type", "<select>" );
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
for ( int i = 0; i < deviceType->count(); ++i )
{
if ( deviceType->text( i ) == device )
{
deviceType->setCurrentItem( i );
break;
}
}
#else
deviceType->setCurrentText( device );
#endif
}
else
{
performAutodetection();
}
prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
c->setGroup( "Capture" );
writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) );
captureFileName->setEnabled( writeCaptureFile->isChecked() );
getCaptureFileName->setEnabled( writeCaptureFile->isChecked() );
parsePackets->setEnabled( writeCaptureFile->isChecked() );
captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) );
hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) );
hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) );
c->setGroup( "UI" );
lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
openTree->setChecked( c->readBoolEntry( "openTree", true ) );
disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm
newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click
newClientScript->setText( c->readEntry( "newClientScript", "" ) );
newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click
newStationScript->setText( c->readEntry( "newStationScript", "" ) );
synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
c->setGroup( "GPS" );
enableGPS->setChecked( c->readBoolEntry( "use", false ) );
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
gpsdHost->setCurrentItem( 0 );
#else
gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) );
#endif
gpsdPort->setValue( c->readNumEntry( "port", 2947 ) );
startGPS->setChecked( c->readBoolEntry( "start", false ) );
commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) );
#endif
}
void WellenreiterConfigWindow::save()
{
#ifdef Q_WS_X11
#warning Persistent Configuration not yet implemented for standalone X11 build
#else
odebug << "saving configuration settings..." << oendl;
/* This is dumb monkey typing stuff... We _need_ to do this automatically! */
OConfig* c = oApp->config();
c->setGroup( "Interface" );
c->writeEntry( "name", interfaceName->currentText() );
c->writeEntry( "type", deviceType->currentText() );
c->writeEntry( "prism", prismHeader->isChecked() );
c->writeEntry( "hop", hopChannels->isChecked() );
c->writeEntry( "interval", hopInterval->value() );
c->writeEntry( "adaptive", adaptiveHopping->isChecked() );
c->setGroup( "Capture" );
c->writeEntry( "writeCaptureFile", writeCaptureFile->isChecked() );
c->writeEntry( "filename", captureFileName->text() );
c->writeEntry( "hexViewBufferUnlimited", hexViewBufferUnlimited->isChecked() );
c->writeEntry( "hexViewBufferSize", hexViewBufferSize->value() );
c->setGroup( "UI" );
c->writeEntry( "lookupVendor", lookupVendor->isChecked() );
c->writeEntry( "openTree", openTree->isChecked() );
c->writeEntry( "disablePM", disablePM->isChecked() );
c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() );
c->writeEntry( "newNetworkScript", newNetworkScript->text() );
c->writeEntry( "newClientAction", newClientAction->currentItem() );
c->writeEntry( "newClientScript", newClientScript->text() );
c->writeEntry( "newStationAction", newStationAction->currentItem() );
c->writeEntry( "newStationScript", newStationScript->text() );
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 9638686..088171c 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -18,164 +18,164 @@
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "appearance.h"
#include "editScheme.h"
#include "stylelistitem.h"
#include "decolistitem.h"
#include "colorlistitem.h"
#include "exceptlistitem.h"
#include "sample.h"
/* OPIE */
#include <opie2/odevice.h>
#include <opie2/ofiledialog.h>
#include <opie2/otabwidget.h>
#include <opie2/odebug.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpemessagebox.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpestyle.h>
#include <qpe/lightstyle.h>
#include <qpe/styleinterface.h>
/* QT */
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdialog.h>
#include <qdir.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qstylefactory.h>
#endif
#include <qtoolbutton.h>
#include <qwindowsstyle.h>
#include <qlistview.h>
#include <qheader.h>
#include <qvbox.h>
#include <qwhatsthis.h>
using namespace Opie;
using namespace Opie::Ui;
using namespace Opie::Core;
class DefaultWindowDecoration : public WindowDecorationInterface
{
public:
DefaultWindowDecoration() : ref(0) {}
QString name() const
{
return "Default";
}
QPixmap icon() const
{
return QPixmap();
}
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_WindowDecoration )
*iface = this;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_REFCOUNT
private:
ulong ref;
};
QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
{
QWidget* tab = new QWidget( parent, "StyleTab" );
QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
m_style_list = new QListBox( tab, "m_style_list" );
vertLayout->addWidget( m_style_list );
QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) );
m_style_settings = new QPushButton ( tr( "Settings..." ), tab );
connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked()));
vertLayout-> addWidget ( m_style_settings );
QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) );
QString s = cfg. readEntry ( "Style", "Light" );
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
m_style_list->insertStringList(QStyleFactory::styles());
#else
m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( )));
m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( )));
m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( )));
#endif
{
QString path = QPEApplication::qpeDir ( );
path.append( "/plugins/styles/" );
QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
{
QString libstr = path;
libstr.append( "/" );
libstr.append( *it );
QLibrary *lib = new QLibrary ( libstr );
StyleInterface *iface;
if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
{
StyleListItem *slit = new StyleListItem ( lib, iface );
m_style_list-> insertItem ( slit );
if ( slit-> key ( ) == s )
m_style_list-> setCurrentItem ( slit );
}
else
delete lib;
}
}
m_original_style = m_style_list-> currentItem ( );
styleClicked ( m_original_style );
connect( m_style_list, SIGNAL( highlighted(int) ), this, SLOT( styleClicked(int) ) );
return tab;
}
QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
{
QWidget* tab = new QWidget( parent, "DecoTab" );
QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
m_deco_list = new QListBox( tab, "m_deco_list" );
vertLayout->addWidget( m_deco_list );
diff --git a/noncore/settings/doctab/doctab.cpp b/noncore/settings/doctab/doctab.cpp
index feaf538..72eda6b 100644
--- a/noncore/settings/doctab/doctab.cpp
+++ b/noncore/settings/doctab/doctab.cpp
@@ -1,94 +1,94 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "doctab.h"
#include <qpe/global.h>
#include <qpe/fontmanager.h>
#include <qpe/config.h>
#include <qpe/applnk.h>
#include <qpe/qpedialog.h>
#include <qpe/qpeapplication.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#include <qpe/qcopenvelope_qws.h>
#endif
#include <qlabel.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qtabwidget.h>
#include <qslider.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdatastream.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <qlistbox.h>
#include <qdir.h>
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qstylefactory.h>
#endif
#include <stdlib.h>
DocTabSettings::DocTabSettings( QWidget* parent, const char* name, WFlags fl )
: DocTabSettingsBase( parent, name, TRUE, fl )
{
dl = new QPEDialogListener(this);
reset();
}
DocTabSettings::~DocTabSettings()
{}
void DocTabSettings::accept()
{
applyDocTab();
QDialog::accept();
}
void DocTabSettings::applyDocTab()
{
Config cfg( "Launcher" );
cfg.setGroup( "DocTab" );
cfg.writeEntry( "Enable", yes->isChecked() );
cfg.write();
}
void DocTabSettings::reject()
{
reset();
QDialog::reject();
}
void DocTabSettings::reset()
{
}
QString DocTabSettings::actualDocTab;
void DocTabSettings::done(int r)
{
QDialog::done(r);
close();
}
diff --git a/noncore/settings/language/language.cpp b/noncore/settings/language/language.cpp
index 14750ac..bf90576 100644
--- a/noncore/settings/language/language.cpp
+++ b/noncore/settings/language/language.cpp
@@ -1,94 +1,94 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "settings.h"
#include <qpe/global.h>
#include <qpe/fontmanager.h>
#include <qpe/config.h>
#include <qpe/applnk.h>
#include <qpe/qpedialog.h>
#include <qpe/qpeapplication.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#include <qpe/qcopenvelope_qws.h>
#endif
#include <qlabel.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qtabwidget.h>
#include <qslider.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdatastream.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <qlistbox.h>
#include <qdir.h>
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qstylefactory.h>
#endif
#include <stdlib.h>
LanguageSettings::LanguageSettings( QWidget* parent, const char* name, WFlags fl )
: LanguageSettingsBase( parent, name, TRUE, fl )
{
if ( FontManager::hasUnicodeFont() )
languages->setFont(FontManager::unicodeFont(FontManager::Proportional));
QString tfn = QPEApplication::qpeDir() + "i18n/";
QDir langDir = tfn;
QStringList list = langDir.entryList("*", QDir::Dirs );
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
QString name = (*it);
QFileInfo desktopFile( tfn + "/" + name + "/.directory" );
if ( desktopFile.exists() ) {
langAvail.append(name);
Config conf( desktopFile.filePath(), Config::File );
QString langName = conf.readEntry( "Name" );
QString ownName = conf.readEntryDirect( "Name[" + name + "]" );
if ( ownName.isEmpty() )
ownName = conf.readEntryDirect( "Name" );
if ( !ownName.isEmpty() && ownName != langName )
langName = langName + " [" + ownName + "]";
languages->insertItem( langName );
}
}
if ( langAvail. find ( "en" ) == -1 ) {
langAvail. prepend ( "" ); // no tr
languages-> insertItem ( QString ( "English [%1] (%2)" /* no tr (!) */ ). arg ( tr ( "English" )). arg ( tr( "default" )), 0 );
}
dl = new QPEDialogListener(this);
reset();
}
LanguageSettings::~LanguageSettings()
{}
void LanguageSettings::accept()
diff --git a/noncore/settings/networksettings/interfaces/module.h b/noncore/settings/networksettings/interfaces/module.h
index 9dc913e..13189c3 100644
--- a/noncore/settings/networksettings/interfaces/module.h
+++ b/noncore/settings/networksettings/interfaces/module.h
@@ -1,53 +1,53 @@
#ifndef NETCONF_MODULE_H
#define NETCONF_MODULE_H
#include <qobject.h>
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#include <qlist.h>
#else
#include <qptrlist.h>
#endif
#include <qmap.h>
#include "interface.h"
class QWidget;
class QTabWidget;
/**
* \brief The basis of all plugins
*
* This is the way to extend networksettings with
* extra functionality.
*
*
* Networksettings in the 1.0 release does not use QCOM
* for activation. You need to provide the following function yourself.
*
* A module needs to provide Name, Images, and methods for
* claiming interfaces. For example you can claim physicla
* interfaces like wlan0, ppp0 or virtual like a VPN
* connection and hide the real ppp device or ethernet device
* behind your VPN plugin.
*
* During start up. The main application searches for network devices
* and then looks for an owner under the plugins for them.
* For example the WLAN Plugin looks if there is a WLAN Extension
* on that interface and then claims it by returning true from isOwner()
*
* \code
* extern "C"
* {
* void* create_plugin() {
* return new WLANModule();
* }
* };
* \endcode
* @see isOwner(Interface*)
*/
class Module : private QObject{
signals:
/**
* Emit this Signal once you change the Interface
* you're operating on
diff --git a/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
index 84f1cf6..9049af4 100644
--- a/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
+++ b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
@@ -1,41 +1,41 @@
#include "addconnectionimp.h"
#include <qlistview.h>
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#include <qlist.h>
#else
#include <qptrlist.h>
#endif
#include <qlabel.h>
#include <qheader.h>
/**
* Constructor
*/
AddConnectionImp::AddConnectionImp(QWidget *parent, const char *name, WFlags f):AddConnection(parent, name, f){
connect(registeredServicesList, SIGNAL(selectionChanged()), this, SLOT(changed()));
registeredServicesList->header()->hide();
};
/**
* The current item changed, update the discription.
*/
void AddConnectionImp::changed(){
QListViewItem *item = registeredServicesList->currentItem();
if(item)
help->setText(list[item->text(0)]);
}
/**
* Save a copy of newList for the discriptions and append them all to the view
* @param newList the new list of possible interfaces
*/
void AddConnectionImp::addConnections(const QMap<QString, QString> &newList){
list = newList;
QMap<QString, QString>::Iterator it;
for( it = list.begin(); it != list.end(); ++it )
(void)new QListViewItem(registeredServicesList, it.key());
registeredServicesList->setCurrentItem(registeredServicesList->firstChild());
}
// addserviceimp.cpp
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
index 5f23aea..8feb7a5 100644
--- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
@@ -1,76 +1,76 @@
#include "mainwindowimp.h"
#include "addconnectionimp.h"
#include "interfaceinformationimp.h"
#include "interfacesetupimp.h"
#include "interfaces.h"
#include "module.h"
/* OPIE */
#include <opie2/odebug.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/qlibrary.h>
#include <qpe/resource.h>
/* QT */
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qheader.h>
#include <qlabel.h>
#include <qtabwidget.h> // in order to disable the profiles tab
#include <qmessagebox.h>
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
#include <qlist.h>
#else
#include <qptrlist.h>
#endif
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qregexp.h>
/* STD */
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme"
#define _PROCNETDEV "/proc/net/dev"
MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME)
{
connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked()));
connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked()));
//remove tab with no function
tabWidget->removePage( tab );
// Load connections.
// /usr/local/kde/lib/libinterfaces.la
loadModules(QPEApplication::qpeDir() + "plugins/networksettings");
getAllInterfaces();
Interfaces i;
QStringList list = i.getInterfaceList();
QMap<QString, Interface*>::Iterator it;
for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni )
{
/*
* we skipped it in getAllInterfaces now
* we need to ignore it as well
*/
if (m_handledIfaces.contains( *ni) )
{
odebug << "Not up iface handled by module" << oendl;
continue;
}
bool found = false;
for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it )
diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp
index 022d938..487177c 100644
--- a/noncore/unsupported/qpdf/QOutputDev.cpp
+++ b/noncore/unsupported/qpdf/QOutputDev.cpp
@@ -549,97 +549,97 @@ void QOutputDev::doClip ( GfxState *state, bool winding )
// Transform points in the path and convert curves to line segments.
// Builds a set of subpaths and returns the number of subpaths.
// If <fillHack> is set, close any unclosed subpaths and activate a
// kludge for polygon fills: First, it divides up the subpaths into
// non-overlapping polygons by simply comparing bounding rectangles.
// Then it connects subaths within a single compound polygon to a single
// point so that X can fill the polygon (sort of).
//
int QOutputDev::convertPath ( GfxState *state, QPointArray &points, QArray<int> &lengths )
{
GfxPath *path = state-> getPath ( );
int n = path-> getNumSubpaths ( );
lengths. resize ( n );
// do each subpath
for ( int i = 0; i < n; i++ ) {
// transform the points
lengths [i] = convertSubpath ( state, path-> getSubpath ( i ), points );
}
return n;
}
//
// Transform points in a single subpath and convert curves to line
// segments.
//
int QOutputDev::convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArray &points )
{
int oldcnt = points. count ( );
fp_t x0, y0, x1, y1, x2, y2, x3, y3;
int m = subpath-> getNumPoints ( );
int i = 0;
while ( i < m ) {
if ( i >= 1 && subpath-> getCurve ( i )) {
state-> transform ( subpath-> getX ( i - 1 ), subpath-> getY ( i - 1 ), &x0, &y0 );
state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 );
state-> transform ( subpath-> getX ( i + 1 ), subpath-> getY ( i + 1 ), &x2, &y2 );
state-> transform ( subpath-> getX ( i + 2 ), subpath-> getY ( i + 2 ), &x3, &y3 );
QPointArray tmp;
tmp. setPoints ( 4, lrint ( x0 ), lrint ( y0 ), lrint ( x1 ), lrint ( y1 ),
lrint ( x2 ), lrint ( y2 ), lrint ( x3 ), lrint ( y3 ));
-#if QT_VERSION < 300
+#if QT_VERSION < 0x030000
tmp = tmp. quadBezier ( );
for ( uint loop = 0; loop < tmp. count ( ); loop++ ) {
QPoint p = tmp. point ( loop );
points. putPoints ( points. count ( ), 1, p. x ( ), p. y ( ));
}
#else
tmp = tmp. cubicBezier ( );
points. putPoints ( points. count ( ), tmp. count ( ), tmp );
#endif
i += 3;
}
else {
state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 );
points. putPoints ( points. count ( ), 1, lrint ( x1 ), lrint ( y1 ));
++i;
}
}
return points. count ( ) - oldcnt;
}
void QOutputDev::beginString ( GfxState *state, GString */*s*/ )
{
m_text-> beginString ( state );
}
void QOutputDev::endString ( GfxState */*state*/ )
{
m_text-> endString ( );
}
void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y,
fp_t dx, fp_t dy, fp_t originX, fp_t originY,
CharCode code, Unicode *u, int uLen )
{
fp_t x1, y1, dx1, dy1;
if ( uLen > 0 )
m_text-> addChar ( state, x, y, dx, dy, u, uLen );
// check for invisible text -- this is used by Acrobat Capture
if (( state-> getRender ( ) & 3 ) == 3 ) {
return;
}
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 52419ad..0459caf 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1,153 +1,153 @@
/*
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
* Released under the terms of the GNU GPL v2.0.
*/
#include <qapplication.h>
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <qvbox.h>
#include <qsplitter.h>
#include <qlistview.h>
#include <qtextview.h>
#include <qlineedit.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qaction.h>
#include <qheader.h>
#include <qfiledialog.h>
#include <qregexp.h>
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include <qsettings.h>
#endif
#include <stdlib.h>
#include "lkc.h"
#include "qconf.h"
#include "qconf.moc"
#include "images.c"
static QApplication *configApp;
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
static QSettings *configSettings;
#endif
/*
* update all the children of a menu entry
* removes/adds the entries from the parent widget as necessary
*
* parent: either the menu list widget or a menu entry widget
* menu: entry to be updated
*/
template <class P>
void ConfigList::updateMenuList(P* parent, struct menu* menu)
{
struct menu* child;
ConfigItem* item;
ConfigItem* last;
bool visible;
enum prop_type type;
if (!menu) {
while ((item = parent->firstChild()))
delete item;
return;
}
last = parent->firstChild();
if (last && !last->goParent)
last = 0;
for (child = menu->list; child; child = child->next) {
item = last ? last->nextSibling() : parent->firstChild();
type = child->prompt ? child->prompt->type : P_UNKNOWN;
switch (mode) {
case menuMode:
if (!(child->flags & MENU_ROOT))
goto hide;
break;
case symbolMode:
if (child->flags & MENU_ROOT)
goto hide;
break;
default:
break;
}
visible = menu_is_visible(child);
if (showAll || visible) {
if (!item || item->menu != child)
item = new ConfigItem(parent, last, child, visible);
else
item->testUpdateMenu(visible);
if (mode == fullMode || mode == menuMode || type != P_MENU)
updateMenuList(item, child);
else
updateMenuList(item, 0);
last = item;
continue;
}
hide:
if (item && item->menu == child) {
last = parent->firstChild();
if (last == item)
last = 0;
else while (last->nextSibling() != item)
last = last->nextSibling();
delete item;
}
}
}
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
/*
* set the new data
* TODO check the value
*/
void ConfigItem::okRename(int col)
{
Parent::okRename(col);
sym_set_string_value(menu->sym, text(dataColIdx).latin1());
}
#endif
/*
* update the displayed of a menu entry
*/
void ConfigItem::updateMenu(void)
{
ConfigList* list;
struct symbol* sym;
struct property *prop;
QString prompt;
int type;
tristate expr;
list = listView();
if (goParent) {
setPixmap(promptColIdx, list->menuBackPix);
prompt = "..";
goto set_prompt;
}
sym = menu->sym;
prop = menu->prompt;
prompt = menu_get_prompt(menu);
if (prop) switch (prop->type) {
case P_MENU:
if (list->mode == singleMode || list->mode == symbolMode) {
/* a menuconfig entry is displayed differently
* depending whether it's at the view root or a child.
*/
if (sym && list->rootEntry == menu)
break;
setPixmap(promptColIdx, list->menuPix);
} else {
if (sym)
break;
setPixmap(promptColIdx, 0);
}
@@ -170,97 +170,97 @@ void ConfigItem::updateMenu(void)
char ch;
if (!sym_is_changable(sym) && !list->showAll) {
setPixmap(promptColIdx, 0);
setText(noColIdx, 0);
setText(modColIdx, 0);
setText(yesColIdx, 0);
break;
}
expr = sym_get_tristate_value(sym);
switch (expr) {
case yes:
if (sym_is_choice_value(sym) && type == S_BOOLEAN)
setPixmap(promptColIdx, list->choiceYesPix);
else
setPixmap(promptColIdx, list->symbolYesPix);
setText(yesColIdx, "Y");
ch = 'Y';
break;
case mod:
setPixmap(promptColIdx, list->symbolModPix);
setText(modColIdx, "M");
ch = 'M';
break;
default:
if (sym_is_choice_value(sym) && type == S_BOOLEAN)
setPixmap(promptColIdx, list->choiceNoPix);
else
setPixmap(promptColIdx, list->symbolNoPix);
setText(noColIdx, "N");
ch = 'N';
break;
}
if (expr != no)
setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0);
if (expr != mod)
setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0);
if (expr != yes)
setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0);
setText(dataColIdx, QChar(ch));
break;
case S_INT:
case S_HEX:
case S_STRING:
const char* data;
data = sym_get_string_value(sym);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
int i = list->mapIdx(dataColIdx);
if (i >= 0)
setRenameEnabled(i, TRUE);
#endif
setText(dataColIdx, data);
if (type == S_STRING)
prompt.sprintf("%s: %s", prompt.latin1(), data);
else
prompt.sprintf("(%s) %s", data, prompt.latin1());
break;
}
if (!sym_has_value(sym) && visible)
prompt += " (NEW)";
set_prompt:
setText(promptColIdx, prompt);
}
void ConfigItem::testUpdateMenu(bool v)
{
ConfigItem* i;
visible = v;
if (!menu)
return;
sym_calc_value(menu->sym);
if (menu->flags & MENU_CHANGED) {
/* the menu entry changed, so update all list items */
menu->flags &= ~MENU_CHANGED;
for (i = (ConfigItem*)menu->data; i; i = i->nextItem)
i->updateMenu();
} else if (listView()->updateAll)
updateMenu();
}
void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
{
ConfigList* list = listView();
if (visible) {
if (isSelected() && !list->hasFocus() && list->mode == menuMode)
Parent::paintCell(p, list->inactivedColorGroup, column, width, align);
else
Parent::paintCell(p, cg, column, width, align);
} else
Parent::paintCell(p, list->disabledColorGroup, column, width, align);
}
@@ -445,97 +445,97 @@ void ConfigList::setValue(ConfigItem* item, tristate val)
switch (type) {
case S_BOOLEAN:
case S_TRISTATE:
oldval = sym_get_tristate_value(sym);
if (!sym_set_tristate_value(sym, val))
return;
if (oldval == no && item->menu->list)
item->setOpen(TRUE);
parent()->updateList(item);
break;
}
}
void ConfigList::changeValue(ConfigItem* item)
{
struct symbol* sym;
struct menu* menu;
int type, oldexpr, newexpr;
menu = item->menu;
if (!menu)
return;
sym = menu->sym;
if (!sym) {
if (item->menu->list)
item->setOpen(!item->isOpen());
return;
}
type = sym_get_type(sym);
switch (type) {
case S_BOOLEAN:
case S_TRISTATE:
oldexpr = sym_get_tristate_value(sym);
newexpr = sym_toggle_tristate_value(sym);
if (item->menu->list) {
if (oldexpr == newexpr)
item->setOpen(!item->isOpen());
else if (oldexpr == no)
item->setOpen(TRUE);
}
if (oldexpr != newexpr)
parent()->updateList(item);
break;
case S_INT:
case S_HEX:
case S_STRING:
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (colMap[dataColIdx] >= 0)
item->startRename(colMap[dataColIdx]);
else
#endif
parent()->lineEdit->show(item);
break;
}
}
void ConfigList::setRootMenu(struct menu *menu)
{
enum prop_type type;
if (rootEntry == menu)
return;
type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN;
if (type != P_MENU)
return;
updateMenuList(this, 0);
rootEntry = menu;
updateListAll();
setSelected(currentItem(), hasFocus());
}
void ConfigList::setParentMenu(void)
{
ConfigItem* item;
struct menu *oldroot;
oldroot = rootEntry;
if (rootEntry == &rootmenu)
return;
setRootMenu(menu_get_parent_menu(rootEntry->parent));
QListViewItemIterator it(this);
for (; (item = (ConfigItem*)it.current()); it++) {
if (item->menu == oldroot) {
setCurrentItem(item);
ensureItemVisible(item);
break;
}
}
}
void ConfigList::keyPressEvent(QKeyEvent* ev)
{
QListViewItem* i = currentItem();
ConfigItem* item;
@@ -706,97 +706,97 @@ ConfigView::ConfigView(QWidget* parent, ConfigMainWindow* cview)
lineEdit = new ConfigLineEdit(this);
lineEdit->hide();
this->nextView = viewList;
viewList = this;
}
ConfigView::~ConfigView(void)
{
ConfigView** vp;
for (vp = &viewList; *vp; vp = &(*vp)->nextView) {
if (*vp == this) {
*vp = nextView;
break;
}
}
}
void ConfigView::updateList(ConfigItem* item)
{
ConfigView* v;
for (v = viewList; v; v = v->nextView)
v->list->updateList(item);
}
void ConfigView::updateListAll(void)
{
ConfigView* v;
for (v = viewList; v; v = v->nextView)
v->list->updateListAll();
}
/*
* Construct the complete config widget
*/
ConfigMainWindow::ConfigMainWindow(void)
{
QMenuBar* menu;
QSplitter* split1;
QSplitter* split2;
bool ok;
int x, y, width, height;
QWidget *d = configApp->desktop();
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
width = configSettings->readNumEntry("/kconfig/qconf/window width", d->width() - 64);
height = configSettings->readNumEntry("/kconfig/qconf/window height", d->height() - 64);
resize(width, height);
x = configSettings->readNumEntry("/kconfig/qconf/window x", 0, &ok);
if (ok)
y = configSettings->readNumEntry("/kconfig/qconf/window y", 0, &ok);
if (ok)
move(x, y);
#else
width = d->width() - 64;
height = d->height() - 64;
resize(width, height);
#endif
showDebug = false;
split1 = new QSplitter(this);
split1->setOrientation(QSplitter::Horizontal);
setCentralWidget(split1);
menuView = new ConfigView(split1, this);
menuList = menuView->list;
split2 = new QSplitter(split1);
split2->setOrientation(QSplitter::Vertical);
// create config tree
configView = new ConfigView(split2, this);
configList = configView->list;
helpText = new QTextView(split2);
helpText->setTextFormat(Qt::RichText);
setTabOrder(configList, helpText);
configList->setFocus();
menu = menuBar();
toolBar = new QToolBar("Tools", this);
backAction = new QAction("Back", QPixmap(xpm_back), "Back", 0, this);
connect(backAction, SIGNAL(activated()), SLOT(goBack()));
backAction->setEnabled(FALSE);
QAction *quitAction = new QAction("Quit", "&Quit", CTRL+Key_Q, this);
connect(quitAction, SIGNAL(activated()), SLOT(close()));
QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this);
connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this);
connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
@@ -1221,84 +1221,84 @@ void ConfigMainWindow::showIntro(void)
"which you can then match by examining other options.\n\n";
QMessageBox::information(this, "qconf", str);
}
void ConfigMainWindow::showAbout(void)
{
static char str[] = "qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n\n"
"Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n";
QMessageBox::information(this, "qconf", str);
}
void fixup_rootmenu(struct menu *menu)
{
struct menu *child;
static int menu_cnt = 0;
menu->flags |= MENU_ROOT;
for (child = menu->list; child; child = child->next) {
if (child->prompt && child->prompt->type == P_MENU) {
menu_cnt++;
fixup_rootmenu(child);
menu_cnt--;
} else if (!menu_cnt)
fixup_rootmenu(child);
}
}
static const char *progname;
static void usage(void)
{
printf("%s <config>\n", progname);
exit(0);
}
int main(int ac, char** av)
{
ConfigMainWindow* v;
const char *name;
#ifndef LKC_DIRECT_LINK
kconfig_load();
#endif
progname = av[0];
configApp = new QApplication(ac, av);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
configSettings = new QSettings;
#endif
if (ac > 1 && av[1][0] == '-') {
switch (av[1][1]) {
case 'h':
case '?':
usage();
}
name = av[2];
} else
name = av[1];
if (!name)
usage();
conf_parse(name);
fixup_rootmenu(&rootmenu);
conf_read(NULL);
//zconfdump(stdout);
v = new ConfigMainWindow();
//zconfdump(stdout);
v->show();
configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
configApp->exec();
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
configSettings->writeEntry("/kconfig/qconf/window x", v->pos().x());
configSettings->writeEntry("/kconfig/qconf/window y", v->pos().y());
configSettings->writeEntry("/kconfig/qconf/window width", v->size().width());
configSettings->writeEntry("/kconfig/qconf/window height", v->size().height());
delete configSettings;
#endif
return 0;
}
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index c548884..dee5254 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -96,97 +96,97 @@ public:
if (col >= 0) {
Parent::removeColumn(col);
colRevMap[col] = colMap[idx] = -1;
}
}
void setAllOpen(bool open);
void setParentMenu(void);
template <class P>
void ConfigList::updateMenuList(P*, struct menu*);
bool updateAll;
QPixmap symbolYesPix, symbolModPix, symbolNoPix;
QPixmap choiceYesPix, choiceNoPix;
QPixmap menuPix, menuInvPix, menuBackPix, voidPix;
bool showAll, showName, showRange, showData;
enum listMode mode;
struct menu *rootEntry;
QColorGroup disabledColorGroup;
QColorGroup inactivedColorGroup;
private:
int colMap[colNr];
int colRevMap[colNr];
};
class ConfigItem : public QListViewItem {
typedef class QListViewItem Parent;
public:
ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m), visible(v), goParent(false)
{
init();
}
ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m), visible(v), goParent(false)
{
init();
}
ConfigItem(QListView *parent, ConfigItem *after, bool v)
: Parent(parent, after), menu(0), visible(v), goParent(true)
{
init();
}
~ConfigItem(void);
void init(void);
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
void okRename(int col);
#endif
void updateMenu(void);
void testUpdateMenu(bool v);
ConfigList* listView() const
{
return (ConfigList*)Parent::listView();
}
ConfigItem* firstChild() const
{
return (ConfigItem *)Parent::firstChild();
}
ConfigItem* nextSibling() const
{
return (ConfigItem *)Parent::nextSibling();
}
void setText(colIdx idx, const QString& text)
{
Parent::setText(listView()->mapIdx(idx), text);
}
QString text(colIdx idx) const
{
return Parent::text(listView()->mapIdx(idx));
}
void setPixmap(colIdx idx, const QPixmap& pm)
{
Parent::setPixmap(listView()->mapIdx(idx), pm);
}
const QPixmap* pixmap(colIdx idx) const
{
return Parent::pixmap(listView()->mapIdx(idx));
}
void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
ConfigItem* nextItem;
struct menu *menu;
bool visible;
bool goParent;
};
class ConfigLineEdit : public QLineEdit {
Q_OBJECT
typedef class QLineEdit Parent;
public:
ConfigLineEdit(ConfigView* parent)
: Parent(parent)
{ }
ConfigView* parent(void) const