Move kdialog into apps/

kdialog fits nicely with the idea of apps, in that it is an application that other applications assume are installed.


svn path=/trunk/KDE/kdebase/apps/; revision=462198
This commit is contained in:
Benjamin Meyer 2005-09-20 10:04:09 +00:00
parent 860e5e05a1
commit c92c805d6b
9 changed files with 57 additions and 40 deletions

View file

@ -1 +1 @@
SUBDIRS = kwrite
SUBDIRS = kwrite kdialog

View file

@ -152,7 +152,7 @@ static void outputStringList(QStringList list, bool separateOutput)
static int directCommand(KCmdLineArgs *args)
{
QString title;
bool separateOutput = FALSE;
bool separateOutput = false;
bool printWId = args->isSet("print-winid");
bool embed = args->isSet("embed");
QString defaultEntry;
@ -166,7 +166,7 @@ static int directCommand(KCmdLineArgs *args)
// --separate-output
if (args->isSet("separate-output"))
{
separateOutput = TRUE;
separateOutput = true;
}
if (printWId || embed)
{
@ -238,9 +238,9 @@ static int directCommand(KCmdLineArgs *args)
QString text = QString::fromLocal8Bit(args->getOption( option ));
int pos;
while ((pos = text.find( QString::fromLatin1("\\n") )) >= 0)
while ((pos = text.find( QLatin1String("\\n") )) >= 0)
{
text.replace(pos, 2, QString::fromLatin1("\n"));
text.replace(pos, 2, QLatin1String("\n"));
}
if ( type == KMessageBox::WarningContinueCancel ) {
@ -300,7 +300,7 @@ static int directCommand(KCmdLineArgs *args)
QTimer *timer = new QTimer();
QObject::connect( timer, SIGNAL( timeout() ), kapp, SLOT( quit() ) );
QObject::connect( popup, SIGNAL( clicked() ), kapp, SLOT( quit() ) );
timer->start( duration, TRUE );
timer->start( duration, true );
#ifdef Q_WS_X11
if ( ! kapp->geometryArgument().isEmpty()) {
@ -412,8 +412,8 @@ static int directCommand(KCmdLineArgs *args)
int i;
for (i=0; i<result.count(); i++)
if (!result[i].local8Bit().isEmpty()) {
cout << result[i].local8Bit().data() << endl;
if (!result.at(i).local8Bit().isEmpty()) {
cout << result.at(i).local8Bit().data() << endl;
}
exit( retcode ? 0 : 1 );
}
@ -598,29 +598,29 @@ static int directCommand(KCmdLineArgs *args)
contextStr = QString::fromLocal8Bit(args->arg(0));
}
KIcon::Group group = KIcon::NoGroup;
if ( groupStr == QString::fromLatin1( "Desktop" ) )
if ( groupStr == QLatin1String( "Desktop" ) )
group = KIcon::Desktop;
else if ( groupStr == QString::fromLatin1( "Toolbar" ) )
else if ( groupStr == QLatin1String( "Toolbar" ) )
group = KIcon::Toolbar;
else if ( groupStr == QString::fromLatin1( "MainToolbar" ) )
else if ( groupStr == QLatin1String( "MainToolbar" ) )
group = KIcon::MainToolbar;
else if ( groupStr == QString::fromLatin1( "Small" ) )
else if ( groupStr == QLatin1String( "Small" ) )
group = KIcon::Small;
else if ( groupStr == QString::fromLatin1( "Panel" ) )
else if ( groupStr == QLatin1String( "Panel" ) )
group = KIcon::Panel;
else if ( groupStr == QString::fromLatin1( "User" ) )
else if ( groupStr == QLatin1String( "User" ) )
group = KIcon::User;
KIcon::Context context = KIcon::Any;
// From kicontheme.cpp
if ( contextStr == QString::fromLatin1( "Devices" ) )
if ( contextStr == QLatin1String( "Devices" ) )
context = KIcon::Device;
else if ( contextStr == QString::fromLatin1( "MimeTypes" ) )
else if ( contextStr == QLatin1String( "MimeTypes" ) )
context = KIcon::MimeType;
else if ( contextStr == QString::fromLatin1( "FileSystems" ) )
else if ( contextStr == QLatin1String( "FileSystems" ) )
context = KIcon::FileSystem;
else if ( contextStr == QString::fromLatin1( "Applications" ) )
else if ( contextStr == QLatin1String( "Applications" ) )
context = KIcon::Application;
else if ( contextStr == QString::fromLatin1( "Actions" ) )
else if ( contextStr == QLatin1String( "Actions" ) )
context = KIcon::Action;
KIconDialog dlg(0, "icon dialog");

View file

@ -1,5 +1,5 @@
//
// Copyright (C) 1998 Matthias Hoelzer
// Copyright (C) 1998-2005 Matthias Hoelzer
// email: hoelzer@physik.uni-wuerzburg.de
//
// This program is free software; you can redistribute it and/or modify
@ -26,7 +26,7 @@
#include "klocale.h"
KListBoxDialog::KListBoxDialog(QString text, QWidget *parent)
KListBoxDialog::KListBoxDialog(const QString &text, QWidget *parent)
: KDialogBase( parent, 0, true, QString::null, Ok|Cancel, Ok, true )
{
Q3VBox *page = makeVBoxMainWidget();

View file

@ -1,5 +1,5 @@
//
// Copyright (C) 1998 Matthias Hoelzer
// Copyright (C) 1998-2005 Matthias Hoelzer
// email: hoelzer@physik.uni-wuerzburg.de
//
// This program is free software; you can redistribute it and/or modify
@ -18,8 +18,8 @@
//
#ifndef _KLISTBOXDIALOG_H_
#define _KLISTBOXDIALOG_H_
#ifndef KLISTBOXDIALOG_H
#define KLISTBOXDIALOG_H
#include <kdialogbase.h>
@ -29,7 +29,7 @@ class KListBoxDialog : public KDialogBase
public:
KListBoxDialog(QString text, QWidget *parent=0);
KListBoxDialog(const QString &text, QWidget *parent=0);
~KListBoxDialog() {};
Q3ListBox &getTable() { return *table; };
@ -45,5 +45,4 @@ protected:
};
#endif

View file

@ -1,5 +1,5 @@
//
// Copyright (C) 2004 Stephan Binner <binner@kde.org>
// Copyright (C) 2004-2005 Stephan Binner <binner@kde.org>
//
// 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

View file

@ -1,5 +1,5 @@
//
// Copyright (C) 2004 Stephan Binner <binner@kde.org>
// Copyright (C) 2004-2005 Stephan Binner <binner@kde.org>
//
// 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

View file

@ -1,3 +1,21 @@
//
// Copyright (C) 2004-2005 Stephan Binner <binner@kde.org>
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the7 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 program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
//
#ifndef PROGRESSDIALOGIFACE_H
#define PROGRESSDIALOGIFACE_H

View file

@ -1,6 +1,6 @@
//
// Copyright (C) 1998 Matthias Hoelzer <hoelzer@kde.org>
// Copyright (C) 2002 David Faure <faure@kde.org>
// Copyright (C) 2002-2005 David Faure <faure@kde.org>
//
// 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
@ -85,12 +85,12 @@ bool Widgets::passwordBox(QWidget *parent, const QString& title, const QString&
int Widgets::textBox(QWidget *parent, int width, int height, const QString& title, const QString& file)
{
// KTextBox dlg(parent, 0, TRUE, width, height, file);
// KTextBox dlg(parent, 0, true, width, height, file);
KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok, KDialogBase::Ok );
kapp->setTopWidget( &dlg );
KTextEdit *edit = new KTextEdit( dlg.makeVBoxMainWidget() );
edit->setReadOnly(TRUE);
edit->setReadOnly(true);
QFile f(file);
if (!f.open(IO_ReadOnly))
@ -118,7 +118,7 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString& titl
int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, QString &result)
{
// KTextBox dlg(parent, 0, TRUE, width, height, file);
// KTextBox dlg(parent, 0, true, width, height, file);
KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok, KDialogBase::Ok );
kapp->setTopWidget( &dlg );
@ -131,7 +131,7 @@ int Widgets::textInputBox(QWidget *parent, int width, int height, const QString&
}
KTextEdit *edit = new KTextEdit( vbox );
edit->setReadOnly(FALSE);
edit->setReadOnly(false);
edit->setTextFormat( Qt::PlainText );
edit->setFocus();
@ -215,11 +215,11 @@ bool Widgets::checkList(QWidget *parent, const QString& title, const QString& te
}
table.insertStringList(entries);
table.setMultiSelection(TRUE);
table.setMultiSelection(true);
table.setCurrentItem(0); // This is to circumvent a Qt bug
for (int i=0; i+2<args.count(); i += 3) {
table.setSelected( i/3, args[i+2] == QString::fromLatin1("on") );
table.setSelected( i/3, args[i+2] == QLatin1String("on") );
}
handleXGeometry(&box);
@ -234,7 +234,7 @@ bool Widgets::checkList(QWidget *parent, const QString& title, const QString& te
} else {
for (unsigned int i=0; i<table.count(); i++)
if (table.isSelected(i))
rs += QString::fromLatin1("\"") + tags[i] + QString::fromLatin1("\" ");
rs += QLatin1String("\"") + tags[i] + QLatin1String("\" ");
result.append(rs);
}
}
@ -261,7 +261,7 @@ bool Widgets::radioBox(QWidget *parent, const QString& title, const QString& tex
table.insertStringList(entries);
for (int i=0; i+2<args.count(); i += 3) {
table.setSelected( i/3, args[i+2] == QString::fromLatin1("on") );
table.setSelected( i/3, args[i+2] == QLatin1String("on") );
}
handleXGeometry(&box);

View file

@ -1,6 +1,6 @@
//
// Copyright (C) 1998 Matthias Hoelzer <hoelzer@kde.org>
// Copyright (C) 2002 David Faure <faure@kde.org>
// Copyright (C) 2002-2005 David Faure <faure@kde.org>
//
// 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
@ -18,8 +18,8 @@
//
#ifndef _WIDGETS_H_
#define _WIDGETS_H_
#ifndef WIDGETS_H
#define WIDGETS_H
#include <qwidget.h>
#include <qstring.h>