summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/commandeditdialog.cpp2
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp8
-rw-r--r--core/apps/embeddedkonsole/konsole.h4
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp6
-rw-r--r--core/apps/textedit/textedit.cpp8
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp6
-rw-r--r--core/pim/addressbook/addressbook.cpp6
-rw-r--r--core/pim/addressbook/addressbook.h4
-rw-r--r--core/pim/datebook/datebook.cpp6
-rw-r--r--core/pim/datebook2/mainwindow.cpp4
-rw-r--r--core/pim/datebook2/mainwindow.h6
-rw-r--r--core/pim/osearch/mainwindow.cpp6
-rw-r--r--core/pim/osearch/mainwindow.h2
-rw-r--r--core/pim/todo/mainwindow.cpp2
-rw-r--r--core/pim/todo/quickeditimpl.cpp2
-rw-r--r--core/pim/todo/quickeditimpl.h4
16 files changed, 38 insertions, 38 deletions
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp
index 97b0a9e..dd35466 100644
--- a/core/apps/embeddedkonsole/commandeditdialog.cpp
+++ b/core/apps/embeddedkonsole/commandeditdialog.cpp
@@ -1,103 +1,103 @@
//comandeditdialog.cpp
#include "commandeditdialog.h"
#include "playlistselection.h"
#include <qstring.h>
#include <qpe/config.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qwidget.h>
#include <qmenubar.h>
#include <qpe/resource.h>
#include <qlist.h>
#include <qtoolbutton.h>
#include <qvbox.h>
#include <qlistview.h>
#include <qlineedit.h>
#include <qheader.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include "smallcommandeditdialogbase.h"
CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl )
: CommandEditDialogBase(parent, name, TRUE, fl)
{
m_SuggestedCommandList->addColumn( tr("Command Selection") );
m_SuggestedCommandList->header()->hide();
m_SuggestedCommandList->setSorting(-1,FALSE);
m_SuggestedCommandList->clearSelection();
m_SuggestedCommandList->setSorting(0,TRUE);
QListViewItem *item;
item = new QListViewItem( m_SuggestedCommandList,"export ");
item = new QListViewItem( m_SuggestedCommandList,"ifconfig ");
item = new QListViewItem( m_SuggestedCommandList,"ipkg ");
item = new QListViewItem( m_SuggestedCommandList,"gzip ");
item = new QListViewItem( m_SuggestedCommandList,"gunzip ");
item = new QListViewItem( m_SuggestedCommandList,"chgrp ");
item = new QListViewItem( m_SuggestedCommandList,"chown ");
item = new QListViewItem( m_SuggestedCommandList,"date ");
item = new QListViewItem( m_SuggestedCommandList,"dd ");
item = new QListViewItem( m_SuggestedCommandList,"dmesg ");
item = new QListViewItem( m_SuggestedCommandList,"fuser ");
item = new QListViewItem( m_SuggestedCommandList,"hostname ");
item = new QListViewItem( m_SuggestedCommandList,"kill ");
item = new QListViewItem( m_SuggestedCommandList,"killall ");
item = new QListViewItem( m_SuggestedCommandList,"ln ");
item = new QListViewItem( m_SuggestedCommandList,"ln -s ");
item = new QListViewItem( m_SuggestedCommandList,"lsmod");
item = new QListViewItem( m_SuggestedCommandList,"depmod -a");
item = new QListViewItem( m_SuggestedCommandList,"modprobe ");
item = new QListViewItem( m_SuggestedCommandList,"mount ");
item = new QListViewItem( m_SuggestedCommandList,"more ");
item = new QListViewItem( m_SuggestedCommandList,"sort ");
item = new QListViewItem( m_SuggestedCommandList,"touch ");
item = new QListViewItem( m_SuggestedCommandList,"umount ");
item = new QListViewItem( m_SuggestedCommandList,"mknod ");
item = new QListViewItem( m_SuggestedCommandList,"netstat ");
item = new QListViewItem( m_SuggestedCommandList,"route ");
item = new QListViewItem( m_SuggestedCommandList,"cardctl eject ");
m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE);
m_SuggestedCommandList->sort();
connect( m_SuggestedCommandList, SIGNAL( clicked( QListViewItem * ) ), m_PlayListSelection, SLOT( addToSelection( QListViewItem *) ) );
ToolButton1->setTextLabel("new");
ToolButton1->setPixmap(Resource::loadPixmap("new"));
ToolButton1->setAutoRaise(TRUE);
ToolButton1->setFocusPolicy(QWidget::NoFocus);
connect(ToolButton1,SIGNAL(clicked()),this,SLOT(showAddDialog()));
ToolButton2->setTextLabel("edit");
ToolButton2->setPixmap(Resource::loadPixmap("edit"));
ToolButton2->setAutoRaise(TRUE);
ToolButton2->setFocusPolicy(QWidget::NoFocus);
connect(ToolButton2,SIGNAL(clicked()),this,SLOT(showEditDialog()));
ToolButton3->setTextLabel("delete");
ToolButton3->setPixmap(Resource::loadPixmap("editdelete"));
ToolButton3->setAutoRaise(TRUE);
ToolButton3->setFocusPolicy(QWidget::NoFocus);
connect(ToolButton3,SIGNAL(clicked()),m_PlayListSelection,SLOT(removeSelected()));
ToolButton4->setTextLabel("up");
ToolButton4->setPixmap(Resource::loadPixmap("up"));
ToolButton4->setAutoRaise(TRUE);
ToolButton4->setFocusPolicy(QWidget::NoFocus);
connect(ToolButton4,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedUp()));
ToolButton5->setTextLabel("down");
ToolButton5->setPixmap(Resource::loadPixmap("down"));
ToolButton5->setAutoRaise(TRUE);
ToolButton5->setFocusPolicy(QWidget::NoFocus);
connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown()));
QListViewItem *current = m_SuggestedCommandList->selectedItem();
if ( current )
item->moveItem( current );
m_SuggestedCommandList->setSelected( item, TRUE );
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d855d90..fff2f68 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -1,127 +1,127 @@
/* ---------------------------------------------------------------------- */
/* */
/* [main.C] Konsole */
/* */
/* ---------------------------------------------------------------------- */
/* */
/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
/* */
/* This file is part of Konsole, an X terminal. */
/* */
/* The material contained in here more or less directly orginates from */
/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
/* */
/* ---------------------------------------------------------------------- */
/* */
/* Ported Konsole to Qt/Embedded */
/* */
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
/* */
/* -------------------------------------------------------------------------- */
// enhancements added by L.J. Potter <ljp@llornkcor.com>
#define QT_QWS_OPIE
#include <qpe/resource.h>
#include <qdir.h>
#include <qevent.h>
#include <qdragobject.h>
#include <qobjectlist.h>
#include <qtoolbutton.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpushbutton.h>
#include <qfontdialog.h>
#include <qglobal.h>
#include <qpainter.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qaction.h>
#include <qapplication.h>
#include <qfontmetrics.h>
#include <qcombobox.h>
#include <qevent.h>
#include <qtabwidget.h>
#include <qtabbar.h>
#include <qpe/config.h>
#include <qstringlist.h>
#include <qpalette.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "konsole.h"
#include "keytrans.h"
#include "commandeditdialog.h"
#ifdef QT_QWS_OPIE
#include <opie/colorpopupmenu.h>
#endif
class EKNumTabBar : public QTabBar {
public:
void numberTabs()
{
// Yes, it really is this messy. QTabWidget needs functions
// that provide acces to tabs in a sequential way.
int m=INT_MIN;
for (int i=0; i<count(); i++) {
QTab* left=0;
QListIterator<QTab> it(*tabList());
int x=INT_MAX;
for( QTab* t; (t=it.current()); ++it ) {
int tx = t->rect().x();
if ( tx<x && tx>m ) {
x = tx;
left = t;
}
}
if ( left ) {
left->setText(QString::number(i+1));
m = left->rect().x();
}
}
}
};
class EKNumTabWidget : public QTabWidget {
public:
EKNumTabWidget(QWidget* parent) : QTabWidget(parent)
{
}
void addTab(QWidget* w)
{
QTab* t = new QTab(QString::number(tabBar()->count()+1));
QTabWidget::addTab(w,t);
}
void removeTab(QWidget* w)
{
removePage(w);
((EKNumTabBar*)tabBar())->numberTabs();
}
};
// This could be configurable or dynamicly generated from the bash history
// file of the user
static const char *commonCmds[] =
{
"ls ", // I left this here, cause it looks better than the first alpha
"cardctl eject",
"cat ",
"cd ",
"chmod ",
"clear",
"cp ",
"dc ",
"df ",
"dmesg",
"echo ",
"env",
"find ",
"free",
@@ -189,288 +189,288 @@ static void konsoleInit(const char** shell) {
*shell = getenv("SHELL");
qWarning("SHell initially is %s", *shell );
if (shell == NULL || *shell == '\0') {
struct passwd *ent = 0;
uid_t me = getuid();
*shell = "/bin/sh";
while ( (ent = getpwent()) != 0 ) {
if (ent->pw_uid == me) {
if (ent->pw_shell != "")
*shell = ent->pw_shell;
break;
}
}
endpwent();
}
qWarning("SHELL now is %s", *shell );
if( putenv((char*)"COLORTERM=") !=0)
qDebug("putenv failed"); // to trigger mc's color detection
}
Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) :
QMainWindow(parent, name, fl)
{
QStrList tmp; const char* shell;
setCaption( tr("Terminal") );
konsoleInit( &shell);
qWarning("Using shell %s", shell);
init(shell,tmp);
}
void Konsole::initCommandList()
{
// qDebug("Konsole::initCommandList");
Config cfg("Konsole");
cfg.setGroup("Commands");
commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
commonCombo->clear();
if (cfg.readEntry("Commands Set","FALSE") == "FALSE") {
for (int i = 0; commonCmds[i] != NULL; i++) {
commonCombo->insertItem(commonCmds[i],i);
}
} else {
for (int i = 0; i < 100; i++) {
if (!(cfg.readEntry( QString::number(i),"")).isEmpty())
commonCombo->insertItem((cfg.readEntry( QString::number(i),"")));
}
}
}
void Konsole::init(const char* _pgm, QStrList & _args)
{
b_scroll = TRUE; // histon;
n_keytab = 0;
n_render = 0;
startUp=0;
fromMenu = FALSE;
setCaption( tr("Terminal") );
setIcon( Resource::loadPixmap( "konsole" ) );
Config cfg("Konsole");
cfg.setGroup("Konsole");
QString tmp;
// initialize the list of allowed fonts ///////////////////////////////////
cfont = cfg.readNumEntry("FontID", 1);
QFont f = QFont("Micro", 4, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Micro"), f));
f = QFont("Fixed", 7, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Small Fixed"), f));
f = QFont("Fixed", 12, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Medium Fixed"), f));
// create terminal emulation framework ////////////////////////////////////
nsessions = 0;
tab = new EKNumTabWidget(this);
connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
// create terminal toolbar ////////////////////////////////////////////////
setToolBarsMovable( FALSE );
- QPEToolBar *menuToolBar = new QPEToolBar( this );
+ QToolBar *menuToolBar = new QToolBar( this );
menuToolBar->setHorizontalStretchable( TRUE );
QMenuBar *menuBar = new QMenuBar( menuToolBar );
fontList = new QPopupMenu( this );
for(uint i = 0; i < fonts.count(); i++) {
VTFont *fnt = fonts.at(i);
fontList->insertItem(fnt->getName(), i);
}
fontChanged(cfont);
configMenu = new QPopupMenu( this);
colorMenu = new QPopupMenu( this);
scrollMenu = new QPopupMenu( this);
editCommandListMenu = new QPopupMenu( this);
configMenu->insertItem(tr("Command List"), editCommandListMenu);
bool listHidden;
cfg.setGroup("Menubar");
if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
editCommandListMenu->insertItem( tr( "Show command list" ));
listHidden=TRUE;
} else {
editCommandListMenu->insertItem( tr( "Hide command list" ));
listHidden=FALSE;
}
cfg.setGroup("Tabs");
tmp=cfg.readEntry("Position","Bottom");
if(tmp=="Top") {
tab->setTabPosition(QTabWidget::Top);
configMenu->insertItem( tr( "Tabs on Bottom" ) );
} else {
tab->setTabPosition(QTabWidget::Bottom);
configMenu->insertItem(tr("Tabs on Top"));
}
configMenu->insertSeparator(2);
colorMenu->insertItem(tr( "Green on Black"));
colorMenu->insertItem(tr( "Black on White"));
colorMenu->insertItem(tr( "White on Black"));
colorMenu->insertItem(tr( "Black on Transparent"));
colorMenu->insertItem(tr( "Black on Red"));
colorMenu->insertItem(tr( "Red on Black"));
colorMenu->insertItem(tr( "Green on Yellow"));
colorMenu->insertItem(tr( "Blue on Magenta"));
colorMenu->insertItem(tr( "Magenta on Blue"));
colorMenu->insertItem(tr( "Cyan on White"));
colorMenu->insertItem(tr( "White on Cyan"));
colorMenu->insertItem(tr( "Blue on Black"));
colorMenu->insertItem(tr( "Amber on Black"));
#ifdef QT_QWS_OPIE
colorMenu->insertItem(tr( "Custom"));
#endif
configMenu->insertItem( tr("Font"), fontList );
configMenu->insertItem(tr( "Colors") ,colorMenu);
connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) ));
connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
menuBar->insertItem( tr("Options"), configMenu );
- QPEToolBar *toolbar = new QPEToolBar( this );
+ QToolBar *toolbar = new QToolBar( this );
QAction *a;
// Button Commands
a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar );
a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar );
a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar );
a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar );
a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar );
/*
a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
*/
- secondToolBar = new QPEToolBar( this );
+ secondToolBar = new QToolBar( this );
secondToolBar->setHorizontalStretchable( TRUE );
commonCombo = new QComboBox( secondToolBar );
commonCombo->setMaximumWidth(236);
editCommandListMenu->insertItem( tr( "Quick Edit" ) );
if( listHidden) {
secondToolBar->hide();
editCommandListMenu->setItemEnabled(-23 ,FALSE);
}
editCommandListMenu->insertItem(tr( "Edit" ) );
cfg.setGroup("Commands");
commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
initCommandList();
// for (int i = 0; commonCmds[i] != NULL; i++) {
// commonCombo->insertItem( commonCmds[i], i );
// tmp = cfg.readEntry( QString::number(i),"");
// if(tmp != "")
// commonCombo->changeItem( tmp,i );
// }
connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));
scrollMenu->insertItem(tr( "None" ));
scrollMenu->insertItem(tr( "Left" ));
scrollMenu->insertItem(tr( "Right" ));
// scrollMenu->insertSeparator(4);
// scrollMenu->insertItem(tr( "Horizontal" ));
configMenu->insertItem(tr( "ScrollBar" ),scrollMenu);
int jut = configMenu->insertItem(tr( "Wrap" ));
cfg.setGroup("ScrollBar");
configMenu->setItemChecked(jut, cfg.readBoolEntry("HorzScroll",0));
jut = configMenu->insertItem(tr( "Use Beep" ));
cfg.setGroup("Menubar");
configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0));
//scrollMenuSelected(-29);
// cfg.setGroup("ScrollBar");
// if(cfg.readBoolEntry("HorzScroll",0)) {
// if(cfg.readNumEntry("Position",2) == 0)
// te->setScrollbarLocation(1);
// else
// te->setScrollbarLocation(0);
// te->setScrollbarLocation( cfg.readNumEntry("Position",2));
// te->setWrapAt(120);
// }
// create applications /////////////////////////////////////////////////////
setCentralWidget(tab);
// load keymaps ////////////////////////////////////////////////////////////
KeyTrans::loadAll();
for (int i = 0; i < KeyTrans::count(); i++)
{ KeyTrans* s = KeyTrans::find(i);
assert( s );
}
se_pgm = _pgm;
se_args = _args;
se_args.prepend("--login");
parseCommandLine();
// read and apply default values ///////////////////////////////////////////
resize(321, 321); // Dummy.
QSize currentSize = size();
if (currentSize != size())
defaultSize = size();
}
void Konsole::show()
{
if ( !nsessions ) {
newSession();
}
QMainWindow::show();
}
void Konsole::initSession(const char*, QStrList &)
{
QMainWindow::show();
}
Konsole::~Konsole()
{
while (nsessions > 0) {
doneSession(getTe()->currentSession, 0);
}
Config cfg("Konsole");
cfg.setGroup("Konsole");
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h
index e9d0e4b..7d5a908 100644
--- a/core/apps/embeddedkonsole/konsole.h
+++ b/core/apps/embeddedkonsole/konsole.h
@@ -1,144 +1,144 @@
/* ----------------------------------------------------------------------- */
/* */
/* [konsole.h] Konsole */
/* */
/* -------------------------------------------------------------------------- */
/* */
/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
/* */
/* This file is part of Konsole, an X terminal. */
/* */
/* The material contained in here more or less directly orginates from */
/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
/* */
/* -------------------------------------------------------------------------- */
/* */
/* Ported Konsole to Qt/Embedded */
/* */
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
/* */
/* -------------------------------------------------------------------------- */
#ifndef KONSOLE_H
#define KONSOLE_H
#include <qmainwindow.h>
#include <qaction.h>
#include <qpopupmenu.h>
#include <qstrlist.h>
#include <qintdict.h>
#include <qptrdict.h>
#include <qtabwidget.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qcombobox.h>
#include <qcolor.h>
#include "MyPty.h"
#include "TEWidget.h"
#include "TEmuVt102.h"
#include "session.h"
class EKNumTabWidget;
class Konsole : public QMainWindow
{
Q_OBJECT
public:
static QString appName() { return QString::fromLatin1("embeddedkonsole"); }
Konsole(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
~Konsole();
void setColLin(int columns, int lines);
- QPEToolBar *secondToolBar;
+ QToolBar *secondToolBar;
void show();
void setColor();
int lastSelectedMenu;
int startUp;
private slots:
void setDocument(const QString &);
void doneSession(TESession*,int);
void changeColumns(int);
void fontChanged(int);
void configMenuSelected(int );
void colorMenuSelected(int);
void colorMenuIsSelected(int);
void enterCommand(int);
void hitEnter();
void hitSpace();
void hitTab();
void hitPaste();
void hitUp();
void hitDown();
void switchSession(QWidget *);
void newSession();
void changeCommand(const QString &, int);
void initCommandList();
void scrollMenuSelected(int);
void editCommandListMenuSelected(int);
void parseCommandLine();
void changeForegroundColor(const QColor &);
void changeBackgroundColor(const QColor &);
private:
void doWrap();
void init(const char* _pgm, QStrList & _args);
void initSession(const char* _pgm, QStrList & _args);
void runSession(TESession* s);
void setColorPixmaps();
void setHistory(bool);
QSize calcSize(int columns, int lines);
TEWidget* getTe();
QStringList commands;
QLabel * msgLabel;
QColor foreground, background;
bool fromMenu;
private:
class VTFont
{
public:
VTFont(QString name, QFont& font)
{
this->name = name;
this->font = font;
}
QFont& getFont()
{
return font;
}
QString getName()
{
return name;
}
private:
QString name;
QFont font;
};
EKNumTabWidget* tab;
int nsessions;
QList<VTFont> fonts;
int cfont;
QCString se_pgm;
QStrList se_args;
QPopupMenu *fontList,*configMenu,*colorMenu,*scrollMenu,*editCommandListMenu;
QComboBox *commonCombo;
// history scrolling I think
bool b_scroll;
int n_keytab;
int n_scroll;
int n_render;
QString pmPath; // pixmap path
QString dropText;
QFont defaultFont;
QSize defaultSize;
};
#endif
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index ed1c165..6f84ae2 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -1,185 +1,185 @@
/**********************************************************************
** 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.
**
**********************************************************************/
#define QTOPIA_INTERNAL_LANGLIST
#include "helpbrowser.h"
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/mimetype.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qstatusbar.h>
#include <qdragobject.h>
#include <qpixmap.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/qcopenvelope_qws.h>
#include <qtoolbutton.h>
#include <qiconset.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qstylesheet.h>
#include <qmessagebox.h>
#include <qfiledialog.h>
#include <qevent.h>
#include <qlineedit.h>
#include <qobjectlist.h>
#include <qfileinfo.h>
#include <qfile.h>
#include <qdatastream.h>
#include <qprinter.h>
#include <qsimplerichtext.h>
#include <qpaintdevicemetrics.h>
#include <qaction.h>
#include <cctype>
#include "magictextbrowser.h"
HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ),
selectedURL()
{
init( "index.html" );
}
void HelpBrowser::init( const QString& _home )
{
setIcon( Resource::loadPixmap( "HelpBrowser" ) );
setBackgroundMode( PaletteButton );
browser = new MagicTextBrowser( this );
browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
connect( browser, SIGNAL( textChanged() ),
this, SLOT( textChanged() ) );
setCentralWidget( browser );
setToolBarsMovable( FALSE );
if ( !_home.isEmpty() )
browser->setSource( _home );
- QPEToolBar* toolbar = new QPEToolBar( this );
+ QToolBar* toolbar = new QToolBar( this );
toolbar->setHorizontalStretchable( TRUE );
QMenuBar *menu = new QMenuBar( toolbar );
- toolbar = new QPEToolBar( this );
+ toolbar = new QToolBar( this );
// addToolBar( toolbar, "Toolbar");
QPopupMenu* go = new QPopupMenu( this );
backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 );
connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) );
connect( browser, SIGNAL( backwardAvailable( bool ) ),
backAction, SLOT( setEnabled( bool ) ) );
backAction->addTo( go );
backAction->addTo( toolbar );
backAction->setEnabled( FALSE );
forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 );
connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) );
connect( browser, SIGNAL( forwardAvailable( bool ) ),
forwardAction, SLOT( setEnabled( bool ) ) );
forwardAction->addTo( go );
forwardAction->addTo( toolbar );
forwardAction->setEnabled( FALSE );
QAction *a = new QAction( tr( "Home" ), Resource::loadIconSet( "home" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), browser, SLOT( home() ) );
a->addTo( go );
a->addTo( toolbar );
bookm = new QPopupMenu( this );
bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) );
bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) );
bookm->insertSeparator();
connect( bookm, SIGNAL( activated( int ) ),
this, SLOT( bookmChosen( int ) ) );
readBookmarks();
menu->insertItem( tr("Go"), go );
menu->insertItem( tr( "Bookmarks" ), bookm );
resize( 240, 300 );
browser->setFocus();
browser->setFrameStyle( QFrame::NoFrame );
#if !defined(QT_NO_COP)
QCopChannel *addressChannel = new QCopChannel("QPE/HelpBrowser" , this );
connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
#endif
connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
this, SLOT(appMessage(const QCString&, const QByteArray&)) );
}
void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
{
qDebug("reached appMessage");
if ( msg == "showFile(QString)" ) {
QDataStream ds(data,IO_ReadOnly);
QString fn;
ds >> fn;
setDocument( fn );
QPEApplication::setKeepRunning();
showMaximized();
setActiveWindow();
raise();
}
}
void HelpBrowser::setDocument( const QString &doc )
{
if ( !doc.isEmpty() )
browser->setSource( doc );
raise();
}
void HelpBrowser::textChanged()
{
if ( browser->documentTitle().isNull() )
setCaption( tr("Help Browser") );
else
setCaption( browser->documentTitle() ) ;
selectedURL = caption();
}
HelpBrowser::~HelpBrowser()
{
QStringList bookmarks;
QMap<int, Bookmark>::Iterator it2 = mBookmarks.begin();
for ( ; it2 != mBookmarks.end(); ++it2 )
bookmarks.append( (*it2).name + "=" + (*it2).file );
QFile f2( Global::applicationFileName("helpbrowser", "bookmarks") );
if ( f2.open( IO_WriteOnly ) ) {
QDataStream s2( &f2 );
s2 << bookmarks;
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 0e3254f..be18140 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -1,431 +1,431 @@
/**********************************************************************
// 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"
#include <opie/ofileselector.h>
#include <opie/ofiledialog.h>
#include <opie/ofontselector.h>
#include <qpe/fontdatabase.h>
#include <qpe/global.h>
#include <qpe/fileselector.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <qmenubar.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpoint.h>
#include <qtextstream.h>
#include <qdatetime.h>
#include <qclipboard.h>
#include <qstringlist.h>
#include <qaction.h>
#include <qcolordialog.h>
#include <qfileinfo.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qobjectlist.h>
#include <qpopupmenu.h>
#include <qspinbox.h>
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qcheckbox.h>
#include <qcombo.h>
#include <qlayout.h>
#include <qapplication.h>
#include <qtimer.h>
#include <qdir.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h> //getenv
#if QT_VERSION < 300
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 );
}
break;
};
}
void QpeEditor::mouseReleaseEvent( QMouseEvent * ) {
if(this->hasMarkedText()) {
markIt = true;
this->getMarkedRegion( &line1, &col1, &line2, & col2 );
} else {
markIt = false;
}
}
void QpeEditor::find ( const QString &txt, bool caseSensitive,
bool backwards )
{
static bool wrap = false;
int line, col;
if ( wrap ) {
if ( !backwards )
line = col = 0;
wrap = false;
// emit searchWrapped();
} else {
getCursorPosition( &line, &col );
}
//ignore backwards for now....
if ( !backwards ) {
for ( ; ; ) {
if ( line >= numLines() ) {
wrap = true;
//emit notFound();
break;
}
int findCol = getString( line )->find( txt, col, caseSensitive );
if ( findCol >= 0 ) {
setCursorPosition( line, findCol, false );
col = findCol + txt.length();
setCursorPosition( line, col, true );
//found = true;
break;
}
line++;
col = 0;
}
}
}
#else
#error "Must make a QpeEditor that inherits QTextEdit"
#endif
static const int nfontsizes = 6;
static const int fontsize[nfontsizes] = {8,10,12,14,18,24};
TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ), bFromDocView( false )
{
doc = 0;
edited=false;
fromSetDocument=false;
setToolBarsMovable( false );
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
channel = new QCopChannel( "QPE/Application/textedit", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
setIcon( Resource::loadPixmap( "TextEditor" ) );
- QPEToolBar *bar = new QPEToolBar( this );
+ QToolBar *bar = new QToolBar( this );
bar->setHorizontalStretchable( true );
menu = bar;
QMenuBar *mb = new QMenuBar( bar );
QPopupMenu *file = new QPopupMenu( this );
QPopupMenu *edit = new QPopupMenu( this );
QPopupMenu *advancedMenu = new QPopupMenu(this);
font = new QPopupMenu( this );
- bar = new QPEToolBar( this );
+ bar = new QToolBar( this );
editBar = bar;
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
// a->addTo( bar );
a->addTo( file );
a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
a->addTo( bar );
a->addTo( file );
a = new QAction( tr( "Save" ), Resource::loadPixmap("save") ,
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( save() ) );
file->insertSeparator();
a->addTo( bar );
a->addTo( file );
a = new QAction( tr( "Save As" ), Resource::loadPixmap("save") ,
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( saveAs() ) );
a->addTo( file );
a = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
a->addTo( editBar );
a->addTo( edit );
a = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
a->addTo( editBar );
a->addTo( edit );
a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
a->addTo( editBar );
a->addTo( edit );
#ifndef QT_NO_CLIPBOARD
a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) );
a->addTo( edit );
#endif
a = new QAction( tr( "Goto Line..." ), Resource::loadPixmap( "find" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( gotoLine() ) );
edit->insertSeparator();
a->addTo( edit );
a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) );
a->addTo( bar );
a->addTo( edit );
zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 );
connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) );
zin->addTo( font );
zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 );
connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) );
zout->addTo( font );
font->insertSeparator();
font->insertItem(tr("Font"), this, SLOT(changeFont()) );
font->insertSeparator();
font->insertItem(tr("Advanced Features"), advancedMenu);
QAction *wa = new QAction( tr("Wrap lines"),
QString::null, 0, this, 0 );
connect( wa, SIGNAL( toggled(bool) ),
this, SLOT( setWordWrap(bool) ) );
wa->setToggleAction(true);
wa->addTo( advancedMenu);
nStart = new QAction( tr("Start with new file"),
QString::null, 0, this, 0 );
connect( nStart, SIGNAL( toggled(bool) ),
this, SLOT( changeStartConfig(bool) ) );
nStart->setToggleAction(true);
nStart->addTo( advancedMenu );
nStart->setEnabled(false);
nAdvanced = new QAction( tr("Prompt on Exit"),
QString::null, 0, this, 0 );
connect( nAdvanced, SIGNAL( toggled(bool) ),
this, SLOT( doPrompt(bool) ) );
nAdvanced->setToggleAction(true);
nAdvanced->addTo( advancedMenu );
desktopAction = new QAction( tr("Always open linked file"),
QString::null, 0, this, 0 );
connect( desktopAction, SIGNAL( toggled(bool) ),
this, SLOT( doDesktop(bool) ) );
desktopAction->setToggleAction(true);
desktopAction->addTo( advancedMenu);
filePermAction = new QAction( tr("File Permissions"),
QString::null, 0, this, 0 );
connect( filePermAction, SIGNAL( toggled(bool) ),
this, SLOT( doFilePerms(bool) ) );
filePermAction->setToggleAction(true);
filePermAction->addTo( advancedMenu);
searchBarAction = new QAction( tr("Search Bar Open"),
QString::null, 0, this, 0 );
connect( searchBarAction, SIGNAL( toggled(bool) ),
this, SLOT( setSearchBar(bool) ) );
searchBarAction->setToggleAction(true);
searchBarAction->addTo( advancedMenu);
nAutoSave = new QAction( tr("Auto Save 5 min."),
QString::null, 0, this, 0 );
connect( nAutoSave, SIGNAL( toggled(bool) ),
this, SLOT( doTimer(bool) ) );
nAutoSave->setToggleAction(true);
nAutoSave->addTo( advancedMenu);
//font->insertSeparator();
//font->insertItem(tr("About"), this, SLOT( doAbout()) );
mb->insertItem( tr( "File" ), file );
mb->insertItem( tr( "Edit" ), edit );
mb->insertItem( tr( "View" ), font );
- searchBar = new QPEToolBar(this);
+ searchBar = new QToolBar(this);
addToolBar( searchBar, "Search", QMainWindow::Top, true );
searchBar->setHorizontalStretchable( true );
searchEdit = new QLineEdit( searchBar, "searchEdit" );
searchBar->setStretchableWidget( searchEdit );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( search() ) );
a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
a->addTo( searchBar );
a->addTo( edit );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( searchBar );
edit->insertSeparator();
a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) );
a->addTo( edit );
searchBar->hide();
editor = new QpeEditor( this );
setCentralWidget( editor );
editor->setFrameStyle( QFrame::Panel | QFrame::Sunken );
connect( editor, SIGNAL( textChanged() ),
this, SLOT( editorChanged() ) );
QPEApplication::setStylusOperation( editor, QPEApplication::RightOnHold);
Config cfg("TextEdit");
cfg. setGroup ( "Font" );
QFont defaultFont = editor-> font ( );
QString family = cfg. readEntry ( "Family", defaultFont. family ( ));
int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( ));
int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( ));
bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( ));
defaultFont = QFont ( family, size, weight, italic );
editor-> setFont ( defaultFont );
// updateCaption();
cfg.setGroup ( "View" );
promptExit = cfg.readBoolEntry ( "PromptExit", false );
openDesktop = cfg.readBoolEntry ( "OpenDesktop", true );
filePerms = cfg.readBoolEntry ( "FilePermissions", false );
useSearchBar = cfg.readBoolEntry ( "SearchBar", false );
startWithNew = cfg.readBoolEntry ( "startNew", true);
featureAutoSave = cfg.readBoolEntry( "autosave", false);
if(useSearchBar) searchBarAction->setOn(true);
if(promptExit) nAdvanced->setOn( true );
if(openDesktop) desktopAction->setOn( true );
if(filePerms) filePermAction->setOn( true );
if(startWithNew) nStart->setOn( true );
if(featureAutoSave) nAutoSave->setOn(true);
// {
// doTimer(true);
// }
bool wrap = cfg. readBoolEntry ( "Wrap", true );
wa-> setOn ( wrap );
setWordWrap ( wrap );
/////////////////
if( qApp->argc() > 1) {
currentFileName=qApp->argv()[1];
QFileInfo fi(currentFileName);
if(fi.baseName().left(1) == "") {
openDotFile(currentFileName);
} else {
openFile(currentFileName);
}
} else {
edited1=false;
openDotFile("");
}
viewSelection = cfg.readNumEntry( "FileView", 0 );
}
TextEdit::~TextEdit() {
qWarning("textedit d'tor");
delete editor;
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index cfcfd41..5ce53b8 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1,260 +1,260 @@
/**********************************************************************
** 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.
**
**********************************************************************/
// code added by L. J. Potter Sat 03-02-2002 06:17:54
#define QTOPIA_INTERNAL_FSLP
#include <qpe/qcopenvelope_qws.h>
#include <qmenubar.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/fileselector.h>
#include <qpe/qpeapplication.h>
#include <qpe/lnkproperties.h>
#include <qpe/storage.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <qpe/resource.h>
#include <qaction.h>
#include <qcursor.h>
#include <qimage.h>
#include <qfile.h>
#include <qdir.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qlist.h>
#include <qlistbox.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <qlistview.h>
#include <qpoint.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qregexp.h>
#include <qtextstream.h>
//#include <qtimer.h>
#include "playlistselection.h"
#include "playlistwidget.h"
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include <stdlib.h>
#include "audiowidget.h"
#include "videowidget.h"
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
// for setBacklight()
#include <linux/fb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#define BUTTONS_ON_TOOLBAR
#define SIDE_BUTTONS
#define CAN_SAVE_LOAD_PLAYLISTS
extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
extern MediaPlayerState *mediaPlayerState;
static inline QString fullBaseName ( const QFileInfo &fi )
{
QString str = fi. fileName ( );
return str. left ( str. findRev ( '.' ));
}
QString audioMimes ="audio/mpeg;audio/x-wav;application/ogg;audio/x-mod";
// class myFileSelector {
// };
class PlayListWidgetPrivate {
public:
QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
QFrame *playListFrame;
FileSelector *files;
PlayListSelection *selectedFiles;
bool setDocumentUsed;
DocLnk *current;
};
class ToolButton : public QToolButton {
public:
ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
: QToolButton( parent, name ) {
setTextLabel( name );
setPixmap( Resource::loadPixmap( icon ) );
setAutoRaise( TRUE );
setFocusPolicy( QWidget::NoFocus );
setToggleButton( t );
connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
QPEMenuToolFocusManager::manager()->addWidget( this );
}
};
class MenuItem : public QAction {
public:
MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
: QAction( text, QString::null, 0, 0 ) {
connect( this, SIGNAL( activated() ), handler, slot );
addTo( parent );
}
};
PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl ) {
d = new PlayListWidgetPrivate;
d->setDocumentUsed = FALSE;
d->current = NULL;
fromSetDocument = FALSE;
insanityBool=FALSE;
audioScan = FALSE;
videoScan = FALSE;
// menuTimer = new QTimer( this ,"menu timer"),
// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
channel = new QCopChannel( "QPE/Application/opieplayer", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
setBackgroundMode( PaletteButton );
setCaption( tr("OpiePlayer") );
setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) );
setToolBarsMovable( FALSE );
// Create Toolbar
- QPEToolBar *toolbar = new QPEToolBar( this );
+ QToolBar *toolbar = new QToolBar( this );
toolbar->setHorizontalStretchable( TRUE );
// Create Menubar
QMenuBar *menu = new QMenuBar( toolbar );
menu->setMargin( 0 );
- QPEToolBar *bar = new QPEToolBar( this );
+ QToolBar *bar = new QToolBar( this );
bar->setLabel( tr( "Play Operations" ) );
// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list",
// this , SLOT( addSelected()) );
tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close");
tbDeletePlaylist->setFlat(TRUE);
tbDeletePlaylist->setFixedSize(20,20);
d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist",
this , SLOT(addSelected()) );
d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist",
this , SLOT(removeSelected()) );
// d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE );
d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play",
this , SLOT( btnPlay(bool) ), TRUE );
d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle",
mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop",
mediaPlayerState, SLOT(setLooping(bool)), TRUE );
tbDeletePlaylist->hide();
QPopupMenu *pmPlayList = new QPopupMenu( this );
menu->insertItem( tr( "File" ), pmPlayList );
new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) );
new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) );
new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) );
pmPlayList->insertSeparator(-1);
new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) );
new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) );
pmPlayList->insertSeparator(-1);
new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) );
new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) );
QPopupMenu *pmView = new QPopupMenu( this );
menu->insertItem( tr( "View" ), pmView );
fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0);
fullScreenButton->addTo(pmView);
scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0);
scaleButton->addTo(pmView);
skinsMenu = new QPopupMenu( this );
menu->insertItem( tr( "Skins" ), skinsMenu );
skinsMenu->isCheckable();
connect( skinsMenu, SIGNAL( activated( int ) ) ,
this, SLOT( skinsMenuActivated( int ) ) );
populateSkinsMenu();
QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton );
QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton );
QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton );
tabWidget = new QTabWidget( hbox6, "tabWidget" );
// tabWidget->setTabShape(QTabWidget::Triangular);
QWidget *pTab;
pTab = new QWidget( tabWidget, "pTab" );
// playlistView = new QListView( pTab, "playlistview" );
// playlistView->setMinimumSize(236,260);
tabWidget->insertTab( pTab,"Playlist");
// Add the playlist area
QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
d->playListFrame = vbox3;
QGridLayout *layoutF = new QGridLayout( pTab );
layoutF->setSpacing( 2);
layoutF->setMargin( 2);
layoutF->addMultiCellWidget( d->playListFrame , 0, 0, 0, 1 );
QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
d->selectedFiles = new PlayListSelection( hbox2);
QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) );
new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) );
new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) );
QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
QWidget *aTab;
aTab = new QWidget( tabWidget, "aTab" );
audioView = new QListView( aTab, "Audioview" );
QGridLayout *layoutA = new QGridLayout( aTab );
layoutA->setSpacing( 2);
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 406ced6..9f668f4 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -1,205 +1,205 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
** Copyright (C) 2003 Stefan Eilers (eilers.stefan@epost.de)
**
** This file is part of the Open Palmtop Environment (see www.opie.info).
**
** 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.
**
**
**********************************************************************/
#define QTOPIA_INTERNAL_FD
#include "contacteditor.h"
#include "ablabel.h"
#include "abview.h"
#include "abtable.h"
// #include "addresssettings.h"
#include "addressbook.h"
#include <opie/ofileselector.h>
#include <opie/ofiledialog.h>
#include <opie/ocontact.h>
#include <opie/ocontactaccessbackend_vcard.h>
#include <qpe/resource.h>
#include <qpe/ir.h>
#include <qpe/qpemessagebox.h>
#include <qpe/qcopenvelope_qws.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qmenubar.h>
// #include <qtoolbar.h>
// #include <qmenubar.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qaction.h>
#include <qdialog.h>
#include <qdir.h>
#include <qfile.h>
#include <qimage.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qpixmap.h>
#include <qpopupmenu.h>
#include <qstringlist.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
#include <qdatetime.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "picker.h"
#include "configdlg.h"
extern QString addressbookPersonalVCardName();
AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
WFlags f )
: QMainWindow( parent, name, f ),
catMenu (0l),
abEditor(0l),
syncing(FALSE),
m_tableViewButton(0l),
m_cardViewButton(0l)
{
isLoading = true;
m_config.load();
setCaption( tr("Contacts") );
setIcon( Resource::loadPixmap( "AddressBook" ) );
// Settings for Main Menu
// setToolBarsMovable( false );
setToolBarsMovable( !m_config.fixedBars() );
setRightJustification( true );
- QPEToolBar *bar = new QPEToolBar( this );
+ QToolBar *bar = new QToolBar( this );
bar->setHorizontalStretchable( TRUE );
QMenuBar *mbList = new QMenuBar( bar );
mbList->setMargin( 0 );
QPopupMenu *edit = new QPopupMenu( mbList );
mbList->insertItem( tr( "Contact" ), edit );
// Category Menu
catMenu = new QPopupMenu( this );
catMenu->setCheckable( TRUE );
connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
mbList->insertItem( tr("View"), catMenu );
// Create Toolbar
- listTools = new QPEToolBar( this, "list operations" );
+ listTools = new QToolBar( this, "list operations" );
listTools->setHorizontalStretchable( true );
addToolBar( listTools );
moveToolBar( listTools, m_config.getToolBarPos() );
// View Icons
m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/listview" ),
QString::null, 0, this, 0 );
connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
m_tableViewButton->setToggleAction( true );
m_tableViewButton->addTo( listTools );
m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "addressbook/cardview" ), QString::null, 0, this, 0 );
connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
m_cardViewButton->setToggleAction( true );
m_cardViewButton->addTo( listTools );
listTools->addSeparator();
// Other Buttons
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null,
0, this, 0 );
actionNew = a;
connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) );
a->addTo( edit );
a->addTo( listTools );
a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
0, this, 0 );
actionEdit = a;
connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) );
a->addTo( edit );
a->addTo( listTools );
a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
0, this, 0 );
actionTrash = a;
connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) );
a->addTo( edit );
a->addTo( listTools );
// make it possible to go directly to businesscard via qcop call
//#if defined(Q_WS_QWS) // Why this ? (se)
#if !defined(QT_NO_COP)
QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this );
connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
#endif
// #endif
a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ),
QString::null, 0, this, 0 );
actionFind = a;
connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) );
a->addTo( edit );
a->addTo( listTools );
// Much better search widget, taken from QTReader.. (se)
searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE );
searchBar->setHorizontalStretchable( TRUE );
searchBar->hide();
searchEdit = new QLineEdit( searchBar, "searchEdit" );
// QFont f("unifont", 16 /*, QFont::Bold*/);
// searchEdit->setFont( f );
searchBar->setStretchableWidget( searchEdit );
connect( searchEdit, SIGNAL( returnPressed( ) ),
this, SLOT( slotFind( ) ) );
a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
a->addTo( searchBar );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) );
a->addTo( searchBar );
a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ),
QString::null, 0, this, 0 );
//a->setEnabled( FALSE ); we got support for it now :) zecke
actionMail = a;
connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) );
a->addTo( edit );
a->addTo( listTools );
if ( Ir::supported() ) {
a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null,
0, this, 0 );
actionBeam = a;
connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
a->addTo( edit );
a->addTo( listTools );
}
edit->insertSeparator();
a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null,
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index 34bcb2a..9217e95 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -1,137 +1,137 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qt Palmtop 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 Addressbook_H
#define Addressbook_H
// Remove this for OPIE releae 1.0 !
// #define __DEBUG_RELEASE
#include <qmainwindow.h>
#include <qvaluelist.h>
#include <qstringlist.h>
#include <qlineedit.h>
#include "ofloatbar.h"
#include "abview.h"
#include "abconfig.h"
class ContactEditor;
class AbLabel;
class AbTable;
-class QPEToolBar;
+class QToolBar;
class QPopupMenu;
class QToolButton;
class QDialog;
class Ir;
class QAction;
class LetterPicker;
class AddressbookWindow: public QMainWindow
{
Q_OBJECT
public:
enum EntryMode { NewEntry=0, EditEntry };
static QString appName() { return QString::fromLatin1("addressbook"); }
AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
~AddressbookWindow();
protected:
void resizeEvent( QResizeEvent * e );
void editPersonal();
void editEntry( EntryMode );
void closeEvent( QCloseEvent *e );
bool save();
public slots:
void flush();
void reload();
void appMessage(const QCString &, const QByteArray &);
void setDocument( const QString & );
#ifdef __DEBUG_RELEASE
// void slotSave();
#endif
private slots:
void importvCard();
void exportvCard();
void slotListNew();
/* void slotListView(); */
void slotListDelete();
void slotViewBack();
void slotViewEdit();
void slotPersonalView();
void listIsEmpty( bool );
/* void slotSettings(); */
void writeMail();
void slotBeam();
void beamDone( Ir * );
void slotSetCategory( int );
void slotSetLetter( char );
void slotUpdateToolbar();
void slotSetFont(int);
void slotFindOpen();
void slotFindClose();
void slotFind();
void slotNotFound();
void slotWrapAround();
void slotViewSwitched( int );
void slotListView();
void slotCardView();
void slotConfig();
private:
void populateCategories();
QPopupMenu *catMenu;
- QPEToolBar *listTools;
+ QToolBar *listTools;
QToolButton *deleteButton;
enum Panes { paneList=0, paneView, paneEdit };
ContactEditor *abEditor;
LetterPicker *pLabel;
AbView* m_abView;
QWidget *listContainer;
// Searching stuff
OFloatBar* searchBar;
QLineEdit* searchEdit;
QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail;
int viewMargin;
bool syncing;
QFont *defaultFont;
int m_curFontSize;
bool isLoading;
AbConfig m_config;
QAction* m_tableViewButton;
QAction* m_cardViewButton;
int active_view;
};
#endif
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index a040d7c..44f1515 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -1,208 +1,208 @@
/**********************************************************************
** 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.
**
** $Id$
**
**********************************************************************/
#define QTOPIA_INTERNAL_FD
#include "datebook.h"
#include "datebookday.h"
#include "datebooksettings.h"
#include "datebookweek.h"
#include "datebookweeklst.h"
#include "dateentryimpl.h"
#include <qpe/datebookmonth.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/qpedebug.h>
#include <qpe/event.h>
#include <qpe/finddialog.h>
#include <qpe/ir.h>
#include <qmenubar.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include <qpe/sound.h>
#include <qpe/timestring.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/tzselect.h>
#include <qpe/xmlreader.h>
#include <qaction.h>
#include <qcopchannel_qws.h>
#include <qdatetime.h>
#include <qdialog.h>
#include <qfile.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qregexp.h>
#include <qtextcodec.h>
#include <qtextstream.h>
#include <qtimer.h>
#include <qtl.h>
#include <qwidgetstack.h>
#include <qwindowsystem_qws.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
DateBook::DateBook( QWidget *parent, const char *, WFlags f )
: QMainWindow( parent, "datebook", f ),
aPreset( FALSE ),
presetTime( -1 ),
startTime( 8 ), // an acceptable default
rowStyle( 0 ),
bJumpToCurTime(FALSE),
syncing(FALSE),
inSearch(FALSE),
alarmCounter(0)
{
bool needEvilHack= false; // if we need an Evil Hack
QTime t;
t.start();
db = new DateBookDBHack;
qDebug("loading db t=%d", t.elapsed() );
loadSettings();
setCaption( tr("Calendar") );
setIcon( Resource::loadPixmap( "datebook_icon" ) );
setToolBarsMovable( FALSE );
views = new QWidgetStack( this );
setCentralWidget( views );
dayView = 0;
weekView = 0;
weekLstView = 0;
monthView = 0;
-// QPEToolBar *bar = new QPEToolBar( this );
+// QToolBar *bar = new QToolBar( this );
// bar->setHorizontalStretchable( TRUE );
// QMenuBar *mb = new QMenuBar( bar );
// mb->setMargin( 0 );
// QPopupMenu *view = new QPopupMenu( this );
// mb->insertItem( tr( "View" ), view );
- QPEToolBar *sub_bar = new QPEToolBar(this);
+ QToolBar *sub_bar = new QToolBar(this);
sub_bar->setHorizontalStretchable(TRUE);
QActionGroup *g = new QActionGroup( this );
g->setExclusive( TRUE );
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
a->addTo( sub_bar );
sub_bar->addSeparator();
a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) );
a->addTo( sub_bar );
// a->addTo( view );
sub_bar->addSeparator();
a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) );
a->addTo( sub_bar );
// a->addTo( view );
a->setToggleAction( TRUE );
a->setOn( TRUE );
dayAction = a;
a = new QAction( tr( "Week" ), Resource::loadPixmap( "week" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) );
a->addTo( sub_bar );
// a->addTo( view );
a->setToggleAction( TRUE );
weekAction = a;
a = new QAction( tr( "WeekLst" ), Resource::loadPixmap( "datebook/weeklst" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewWeekLst() ) );
a->addTo( sub_bar );
// a->addTo( view );
a->setToggleAction( TRUE );
weekLstAction = a;
a = new QAction( tr( "Month" ), Resource::loadPixmap( "month" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewMonth() ) );
a->addTo( sub_bar );
// a->addTo( view );
a->setToggleAction( TRUE );
monthAction = a;
sub_bar->addSeparator();
a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 );
connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
a->addTo( sub_bar );
a = new QAction( tr( "Edit..." ), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
a->addTo( sub_bar );
if(defaultView==DAY) viewDay();
if(defaultView==WEEK) needEvilHack=true; // viewWeek();
if(defaultView==WEEKLST) viewWeekLst();
if(defaultView==MONTH) viewMonth();
connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) );
connect( qApp, SIGNAL(weekChanged(bool)), this, SLOT(changeWeek(bool)) );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), this, SLOT(appMessage(const QCString&, const QByteArray&)) );
#endif
// listen on QPE/System
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/System", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
channel = new QCopChannel( "QPE/Datebook", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
qDebug("olle\n");
#endif
#endif
qDebug("done t=%d", t.elapsed() );
connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) );
/*
* Here is a problem description:
* When Weekview is the default view
* a DateBookWeekView get's created
* redraw() get's called. So what?
* Remember that we're still in the c'tor
* and no final layout has happened? Ok
* now all Events get arranged. Their x
* position get's determined by a QHeader
* position. But the QHeader isn't layouted or
* at the right position. redraw() is a slot
* so we'll call it then via a singleShot
diff --git a/core/pim/datebook2/mainwindow.cpp b/core/pim/datebook2/mainwindow.cpp
index 7d436ae..be30415 100644
--- a/core/pim/datebook2/mainwindow.cpp
+++ b/core/pim/datebook2/mainwindow.cpp
@@ -1,189 +1,189 @@
#include <qcopchannel_qws.h>
#include <qwidgetstack.h>
#include <qlabel.h>
#include <qaction.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qpe/qpeapplication.h>
#include <qpe/ir.h>
#include <qmenubar.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include "editor.h"
#include "show.h"
#include "templatemanager.h"
#include "bookmanager.h"
#include "mainwindow.h"
using namespace Datebook;
MainWindow::MainWindow()
: OPimMainWindow( "Datebook", 0, 0 ), m_descMan( "Descriptions" ), m_locMan( "Locations" )
{
setIcon( Resource::loadPixmap( "datebook_icon" ) );
initUI();
initManagers();
initView();
initConfig();
QTimer::singleShot(0, this, SLOT(populate() ) );
QCopChannel* chan = new QCopChannel( "QPE/System", this );
connect( chan, SIGNAL( received(const QCString&, const QByteArray& ) ),
this, SLOT( slotReceive( const QCString&, const QByteArray& ) ) );
chan = new QCopChannel( "QPE/Datebook", this );
connect( chan, SIGNAL( received(const QCString&, const QByteArray& ) ),
this, SLOT( slotReceive( const QCString&, const QByteArray& ) ) );
}
MainWindow::~MainWindow() {
m_tempMan.save();
m_locMan.save();
m_descMan.save();
manager()->save();
delete m_manager;
}
void MainWindow::doSetDocument( const QString& str ) {
}
void MainWindow::flush() {
manager()->save();
}
void MainWindow::reload() {
manager()->reload();
}
int MainWindow::create() {
return 0;
}
bool MainWindow::remove( int uid ) {
manager()->remove( uid );
return true;
}
void MainWindow::beam( int uid ) {
}
void MainWindow::show( int uid ) {
eventShow()->show( manager()->event( uid ) );
}
void MainWindow::add( const OPimRecord& ad) {
manager()->add( ad );
}
void MainWindow::edit() {
edit ( currentView()->currentItem() );
}
void MainWindow::edit( int uid ) {
}
/*
* init tool bars layout and so on
*/
void MainWindow::initUI() {
setToolBarsMovable( false );
m_stack = new QWidgetStack( this );
setCentralWidget( m_stack );
- m_toolBar = new QPEToolBar( this );
+ m_toolBar = new QToolBar( this );
m_toolBar->setHorizontalStretchable( TRUE );
QMenuBar* mb = new QMenuBar( m_toolBar );
m_popView = new QPopupMenu( this );
m_popSetting = new QPopupMenu( this );
mb->insertItem( tr("View"), m_popView );
mb->insertItem( tr("Settings" ), m_popSetting );
m_popTemplate = new QPopupMenu( this );
m_popTemplate->setCheckable( TRUE );
connect( m_popTemplate, SIGNAL(activated(int) ),
this, SLOT(slotNewFromTemplate(int) ) );
m_popView->insertItem(tr("New from template"), m_popTemplate, -1, 0);
QAction* a = new QAction( tr("New Event"), Resource::loadPixmap("new"),
QString::null, 0, this, 0 );
a->addTo( m_toolBar );
a->addTo( m_popView );
connect(a, SIGNAL( activated() ), this, SLOT( create() ) );
a = new QAction( tr("Edit Event"), Resource::loadPixmap("edit"),
QString::null, 0, this, 0 );
a->addTo( m_popView );
connect(a, SIGNAL( activated() ), this, SLOT( edit() ) );
a = new QAction( tr("Today" ), Resource::loadPixmap( "datebook/to_day"),
QString::null, 0, this, 0 );
a->addTo( m_toolBar );
connect(a, SIGNAL( activated() ), this, SLOT( slotGoToNow() ) );
a = new QAction( tr("Find"), Resource::loadPixmap( "mag" ),
QString::null, 0, this, 0 );
a->addTo( m_toolBar );
connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
a = new QAction( tr("Configure"), QString::null, 0, 0 );
a->addTo( m_popSetting );
connect(a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) );
a = new QAction( tr("Configure Locations"), QString::null, 0, 0 );
a->addTo( m_popSetting );
connect(a, SIGNAL( activated() ), this, SLOT( slotConfigureLocs() ) );
a = new QAction( tr("Configure Descriptions"), QString::null, 0, 0 );
a->addTo( m_popSetting );
connect(a, SIGNAL( activated() ), this, SLOT(slotConfigureDesc() ) );
a = new QAction( tr("Configure Templates"), QString::null, 0, 0 );
a->addTo( m_popSetting );
connect(a, SIGNAL( activated() ), this, SLOT(slotConfigureTemp() ) );
connect( qApp, SIGNAL(clockChanged(bool) ),
this, SLOT(slotClockChanged(bool) ) );
connect( qApp, SIGNAL(weekChanged(bool) ),
this, SLOT(slotWeekChanged(bool) ) );
connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray& ) ),
this, SLOT(slotAppMessage( const QCString&, const QByteArray& ) ) );
}
void MainWindow::initConfig() {
}
void MainWindow::initView() {
}
void MainWindow::initManagers() {
m_manager = new BookManager;
m_tempMan.load();
m_locMan.load();
m_descMan.load();
setTemplateMenu();
}
void MainWindow::raiseCurrentView() {
}
/*
* populate the view
*/
void MainWindow::populate() {
if (!manager()->isLoaded() )
manager()->load();
}
void MainWindow::slotGoToNow() {
}
View* MainWindow::currentView() {
}
void MainWindow::slotFind() {
}
diff --git a/core/pim/datebook2/mainwindow.h b/core/pim/datebook2/mainwindow.h
index 3c22637..33ef864 100644
--- a/core/pim/datebook2/mainwindow.h
+++ b/core/pim/datebook2/mainwindow.h
@@ -1,107 +1,107 @@
#ifndef DATE_BOOK_MAIN_WINDOW_H
#define DATE_BOOK_MAIN_WINDOW_H
#include <qlist.h>
#include <opie/opimmainwindow.h>
#include "descriptionmanager.h"
#include "locationmanager.h"
#include "templatemanager.h"
#include "view.h"
class QAction;
class QWidgetStack;
class QPopupMenu;
-class QPEToolBar;
+class QToolBar;
namespace Datebook {
class BookManager;
class Show;
class Editor;
class MainWindow : public OPimMainWindow {
Q_OBJECT
friend class Show; // to avoid QObject
friend class View; // to avoid QObject
friend class Editor;
public:
MainWindow();
~MainWindow();
private slots:
void initUI(); // init the UI
void initConfig(); // apply the config
void initView(); // init the Views..
void initManagers(); // init the Managers including templates, location and description
void raiseCurrentView(); // raise the current View
void slotGoToNow(); // will switch the currentView to the curren date time
void slotFind(); // find!!!
void slotConfigure(); // configure the app
void slotClockChanged(bool); // clock changed
void slotWeekChanged( bool ); // week changed
void slotAppMessage( const QCString&, const QByteArray& ); // qApp message QPE/Application/datebook
void slotReceive( const QCString&, const QByteArray& ); // QPE/System and QPE/Datebook
void slotAction( QAction* ); // View changed
void slotConfigureLocs(); // Configure the Locations
void slotConfigureDesc(); // Configure the Desc
void slotConfigureTemp();
void slotNewFromTemplate(int ); // called when someone chooses the template menu
void setTemplateMenu(); // updates the templateMenu
protected slots:
void populate();
void doSetDocument( const QString& str );
void flush();
void reload();
int create();
bool remove( int uid );
void beam( int uid );
void show( int uid );
void edit( int uid );
void edit();
void add( const OPimRecord& );
private:
- QPEToolBar* toolbar();
+ QToolBar* toolbar();
QPopupMenu* viewMenu();
QPopupMenu* settingsMenu();
QPopupMenu* templateMenu();
View* currentView();
BookManager* manager();
TemplateManager templateManager();
LocationManager locationManager();
DescriptionManager descriptionManager();
void setLocationManager( const LocationManager& );
void setDescriptionManager( const DescriptionManager& );
Show* eventShow();
Editor* editor();
private: // friend functions for Show
void hideShow(); // to hide the view
// off friend Show
// friend of the view
private:
void viewPopup( int );
void viewAdd( const QDate& date );
void viewAdd( const QDateTime&, const QDateTime& );
bool viewAP()const;
bool viewStartMonday()const;
// off view show
private:
QList<View> m_view; // the Views.. not autoDelete
QWidgetStack* m_stack;
- QPEToolBar *m_toolBar;
+ QToolBar *m_toolBar;
QPopupMenu* m_popView;
QPopupMenu* m_popSetting;
QPopupMenu* m_popTemplate;
BookManager* m_manager;
TemplateManager m_tempMan;
DescriptionManager m_descMan;
LocationManager m_locMan;
Show* m_show;
Editor* m_edit;
};
}
#endif
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 80738df..07403a1 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -1,213 +1,213 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#include <qaction.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#include <qstring.h>
#include <qlabel.h>
#include <qfile.h>
#include <qhbuttongroup.h>
#include <qhbox.h>
#include <qpushbutton.h>
#include <qintdict.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qsignalmapper.h>
#include <qtextbrowser.h>
#include <qregexp.h>
#include <qwhatsthis.h>
#include <qmenubar.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include <qpe/config.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <opie/owait.h>
#include "olistview.h"
#include "olistviewitem.h"
#include "resultitem.h"
#include "adresssearch.h"
#include "todosearch.h"
#include "datebooksearch.h"
#include "applnksearch.h"
#include "doclnksearch.h"
#include "mainwindow.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
QMainWindow( parent, name, f ), _currentItem(0)
{
setCaption( tr("OSearch") );
setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
QFrame *mainFrame = new QFrame( this, "mainFrame" );
mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
mainLayout = new QVBoxLayout( mainFrame );
mainLayout->setSpacing( 0 );
mainLayout->setMargin( 0 );
resultsList = new OListView( mainFrame );
resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
mainLayout->addWidget( resultsList );
detailsFrame = new QFrame( mainFrame, "detailsFrame" );
QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame );
richEdit = new QTextView( detailsFrame );
QWhatsThis::add( richEdit, tr("The details of the current result") );
richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
detailsLayout->addWidget( richEdit );
buttonBox = new QHBox( mainFrame, "Button Box" );
_buttonCount = 0;
mainLayout->addWidget( detailsFrame );
mainLayout->addWidget( buttonBox );
detailsFrame->hide();
buttonBox->hide();
searches.append( new AppLnkSearch( resultsList, tr("Applications") ) );
searches.append( new DocLnkSearch( resultsList, tr("Documents") ) );
searches.append( new TodoSearch( resultsList, tr("Todo List") ) );
searches.append( new DatebookSearch( resultsList, tr("Calendar") ) );
searches.append( new AdressSearch( resultsList, tr("Contacts") ) );
setCentralWidget( mainFrame );
popupTimer = new QTimer();
searchTimer = new QTimer();
connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*)));
signalMapper = new QSignalMapper( this );
connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) );
makeMenu();
Config cfg( "osearch", Config::User );
cfg.setGroup( "search_settings" );
actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) );
actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) );
// actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) );
}
void MainWindow::makeMenu()
{
- QPEToolBar *toolBar = new QPEToolBar( this );
- QPEToolBar *searchBar = new QPEToolBar(this);
+ QToolBar *toolBar = new QToolBar( this );
+ QToolBar *searchBar = new QToolBar(this);
QMenuBar *menuBar = new QMenuBar( toolBar );
QPopupMenu *searchMenu = new QPopupMenu( menuBar );
// QPopupMenu *viewMenu = new QPopupMenu( menuBar );
QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
QPopupMenu *searchOptions = new QPopupMenu( cfgMenu );
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Search" ), searchMenu );
menuBar->insertItem( tr( "Settings" ), cfgMenu );
//SETTINGS MENU
cfgMenu->insertItem( tr( "Search" ), searchOptions );
QPopupMenu *pop;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
pop = s->popupMenu();
if (pop){
cfgMenu->insertItem( s->text(0), pop );
}
}
//SEARCH
SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
// QWhatsThis::add( SearchAllAction, tr("Search everything...") );
connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
SearchAllAction->addTo( searchMenu );
searchMenu->insertItem( tr( "Options" ), searchOptions );
//SEARCH OPTIONS
//actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true );
//actionWholeWordsOnly->addTo( searchOptions );
actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
actionCaseSensitiv->addTo( searchOptions );
actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true );
actionWildcards->addTo( searchOptions );
//SEARCH BAR
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
QWhatsThis::add( searchEdit, tr("Enter your search terms here") );
searchEdit->setFocus();
searchBar->setHorizontalStretchable( TRUE );
searchBar->setStretchableWidget( searchEdit );
SearchAllAction->addTo( searchBar );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( setSearch( const QString & ) ) );
}
MainWindow::~MainWindow()
{
Config cfg( "osearch", Config::User );
cfg.setGroup( "search_settings" );
cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
cfg.writeEntry( "wildcards", actionWildcards->isOn() );
//cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() );
}
void MainWindow::setCurrent(QListViewItem *item)
{
if (!item) return;
_currentItem = (OListViewItem*)item;
// _currentItem = dynamic_cast<OListViewItem*>(item);
if (_currentItem->rtti() == OListViewItem::Result){
ResultItem *res = (ResultItem*)item;
// ResultItem *res = dynamic_cast<ResultItem*>(item);
richEdit->setText( res->toRichText() );
QIntDict<QString> acts = res->actions();
QButton *button;
for (uint i = 0; i < acts.count(); i++){
button = buttonMap[i];
if (!button) {
qWarning(" no button for %s", (*acts[i]).latin1() );
button = new QPushButton( buttonBox );
buttonMap.insert( i, button );
signalMapper->setMapping(button, i );
connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
}
button->setText( *acts[i] );
button->show();
}
for (uint i = acts.count(); i < _buttonCount; i++){
button = buttonMap[i];
if (button) button->hide();
}
_buttonCount = acts.count();
detailsFrame->show();
buttonBox->show();
}else {
detailsFrame->hide();
buttonBox->hide();
}
popupTimer->start( 300, true );
diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h
index 75054f0..bdc6c5f 100644
--- a/core/pim/osearch/mainwindow.h
+++ b/core/pim/osearch/mainwindow.h
@@ -1,86 +1,86 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
// (c) 2002-2003 Patrick S. Vogt <tille@handhelds.org>
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <qmainwindow.h>
#include <qdialog.h>
#include <qaction.h>
#include <qlist.h>
#include <qmap.h>
#include <qtimer.h>
#include <qpopupmenu.h>
class QAction;
-class QPEToolBar;
+class QToolBar;
class QHBox;
class QVBoxLayout;
class QTextView;
class QFrame;
class OListView;
class OListViewItem;
class QListViewItem;
class QPopupMenu;
class QTimer;
class QSignalMapper;
class QButton;
class SearchGroup;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
~MainWindow();
static QString appName() { return QString::fromLatin1("osearch"); }
public slots:
void setCurrent(QListViewItem*);
void setSearch( const QString& );
void searchAll();
protected slots:
void slotAction(int);
void showPopup();
void stopTimer( QListViewItem* );
void searchStringChanged();
void optionChanged(int);
private:
QHBox *buttonBox;
QMap<int, QButton*> buttonMap;
QSignalMapper* signalMapper;
OListView *resultsList;
QTextView *richEdit;
OListViewItem *_currentItem;
QVBoxLayout *mainLayout;
QFrame *detailsFrame;
QTimer *popupTimer;
QTimer *searchTimer;
QString _searchString;
QList<SearchGroup> searches;
QAction *SearchAllAction;
QAction *actionCaseSensitiv;
QAction *actionWildcards;
//QAction *actionWholeWordsOnly;
uint _buttonCount;
void makeMenu();
};
#endif
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 7f40645..d06a405 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -119,193 +119,193 @@ void MainWindow::initActions() {
a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) );
a->addTo( m_tool );
a->addTo( m_edit );
m_editAction = a;
a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 );
connect(a, SIGNAL( activated() ),
this, SLOT( slotShowDetails() ) );
a->addTo( m_edit );
m_edit->insertSeparator();
a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ),
QString::null, 0, this, 0 );
connect(a, SIGNAL(activated() ),
this, SLOT(slotDelete() ) );
a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) );
a->addTo( m_tool );
a->addTo( m_edit );
m_deleteAction = a;
a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 );
connect(a, SIGNAL( activated() ),
this, SLOT( slotDeleteAll() ) );
a->addTo(m_edit );
m_deleteAllAction = a;
a = new QAction( QString::null, QWidget::tr("Delete completed"),
0, this, 0 );
connect(a, SIGNAL( activated() ),
this, SLOT( slotDeleteCompleted() ) );
a->addTo(m_edit );
a->setEnabled( TRUE );
m_deleteCompleteAction = a;
m_edit->insertSeparator();
a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 );
connect(a, SIGNAL( activated() ),
this, SLOT( slotDuplicate() ) );
a->addTo(m_edit );
m_duplicateAction = a;
m_edit->insertSeparator();
if ( Ir::supported() ) {
a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) );
a->addTo( m_edit );
a->addTo( m_tool );
}
#if 0
// Options menu
a = new QAction( QWidget::tr("Find"), Resource::loadIconSet( "mag" ),
QString::null, 0, this, 0 );
connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
a->addTo( m_options );
m_findAction = a;
m_options->insertSeparator();
#endif
m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"),
0, this, 0, TRUE );
m_completedAction->addTo( m_options );
m_completedAction->setOn( showCompleted() );
connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) );
a = new QAction( QString::null, QWidget::tr("Show only over-due tasks"),
0, this, 0, TRUE );
a->addTo( m_options );
a->setOn( showOverDue() );
connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) );
m_showDeadLineAction = new QAction( QString::null, QWidget::tr("Show task deadlines"),
0, this, 0, TRUE );
m_showDeadLineAction->addTo( m_options );
m_showDeadLineAction->setOn( showDeadline() );
connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) );
m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"),
0, this, 0, TRUE );
m_showQuickTaskAction->addTo( m_options );
m_showQuickTaskAction->setOn( showQuickTask() );
connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) );
m_options->insertSeparator();
m_bar->insertItem( QWidget::tr("Data") ,m_edit );
m_bar->insertItem( QWidget::tr("Category"), m_catMenu );
m_bar->insertItem( QWidget::tr("Options"), m_options );
m_curQuick = new QuickEditImpl( this, m_quicktask );
- addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE );
+ addToolBar( (QToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE );
m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
}
/* m_curCat from Config */
void MainWindow::initConfig() {
Config config( "todo" );
config.setGroup( "View" );
m_completed = config.readBoolEntry( "ShowComplete", TRUE );
m_curCat = config.readEntry( "Category", QString::null );
m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
m_overdue = config.readBoolEntry("ShowOverDue", FALSE );
m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE);
}
void MainWindow::initUI() {
m_stack = new OWidgetStack(this, "main stack");
setCentralWidget( m_stack );
setToolBarsMovable( FALSE );
QToolBar *menubarholder = new QToolBar( this );
menubarholder->setHorizontalStretchable( TRUE );
m_bar = new QMenuBar( menubarholder );
m_tool = new QToolBar( this );
/** QPopupMenu */
m_edit = new QPopupMenu( this );
m_options = new QPopupMenu( this );
m_catMenu = new QPopupMenu( this );
m_template = new QPopupMenu( this );
m_catMenu->setCheckable( TRUE );
m_template->setCheckable( TRUE );
connect(m_catMenu, SIGNAL(activated(int) ),
this, SLOT(setCategory(int) ) );
connect(m_template, SIGNAL(activated(int) ),
this, SLOT(slotNewFromTemplate(int) ) );
}
void MainWindow::initViews() {
TableView* tableView = new TableView( this, m_stack );
QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) );
m_stack->addWidget( tableView, m_counter++ );
m_views.append( tableView );
m_curView = tableView;
connectBase( tableView );
/* add QString type + QString configname to
* the View menu
* and subdirs for multiple views
*/
}
void MainWindow::initEditor() {
m_curEdit = new Editor();
}
void MainWindow::initShow() {
m_curShow = new TextViewShow(this, this);
m_stack->addWidget( m_curShow->widget() , m_counter++ );
}
MainWindow::~MainWindow() {
delete templateManager();
}
void MainWindow::connectBase( ViewBase* ) {
// once templates and signals mix we'll use it again
}
QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
QPopupMenu* menu = new QPopupMenu();
m_editAction->addTo( menu );
m_deleteAction->addTo( menu );
m_duplicateAction->addTo( menu );
menu->insertSeparator();
/*
* if this event recurs we allow
* to detach it.
* remove all
*/
if ( recur ) {
; // FIXME
}
return menu;
}
QPopupMenu* MainWindow::options() {
qWarning("Options");
return m_options;
}
QPopupMenu* MainWindow::edit() {
return m_edit;
}
QToolBar* MainWindow::toolbar() {
return m_tool;
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index 70e0582..1863ef4 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -1,110 +1,110 @@
#include <qaction.h>
#include <qlineedit.h>
#include <qwhatsthis.h>
#include <qpe/resource.h>
#include <opie/oclickablelabel.h>
#include "mainwindow.h"
#include "quickeditimpl.h"
QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
- : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) {
+ : QToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) {
setHorizontalStretchable( TRUE );
// Load priority icons
// TODO - probably should be done globally somewhere else,
// see also tableview.cpp/h, taskeditoroverview.cpp/h
priority1 = Resource::loadPixmap( "todo/priority1" );
priority3 = Resource::loadPixmap( "todo/priority3" );
priority5 = Resource::loadPixmap( "todo/priority5" );
m_lbl = new OClickableLabel( this );
m_lbl->setMinimumWidth( 15 );
m_lbl->setPixmap( priority3 );
connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
QWhatsThis::add( m_lbl, QWidget::tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
m_edit = new QLineEdit( this );
setStretchableWidget( m_edit );
QWhatsThis::add( m_edit, QWidget::tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
/*
* it's not implemented and won't be implemented for 1.0
*/
#if 0
QAction *a = new QAction( QWidget::tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
a->addTo( this );
a->setWhatsThis( QWidget::tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
#endif
QAction *a = new QAction( QWidget::tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
a->addTo( this );
a->setWhatsThis( QWidget::tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
a = new QAction( QWidget::tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
a->addTo( this );
a->setWhatsThis( QWidget::tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
m_visible = visible;
if ( !m_visible ) {
hide();
}
m_menu = 0l;
reinit();
}
QuickEditImpl::~QuickEditImpl() {
}
OTodo QuickEditImpl::todo()const {
return m_todo;
}
QWidget* QuickEditImpl::widget() {
return this;
}
void QuickEditImpl::slotEnter() {
OTodo todo;
if (!m_edit->text().isEmpty() ) {
todo.setUid(1 ); // new uid
todo.setPriority( m_state );
todo.setSummary( m_edit->text() );
if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 )
todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() );
m_todo = todo;
commit();
}
m_todo = todo;
reinit();
}
void QuickEditImpl::slotPrio() {
m_state -= 2;
if ( m_state < 1 )
m_state = 5;
switch( m_state ) {
case 1:
m_lbl->setPixmap( priority1 );
break;
case 5:
m_lbl->setPixmap( priority5 );
break;
case 3:
default:
m_lbl->setPixmap( priority3 );
break;
}
}
void QuickEditImpl::slotMore() {
// TODO - implement
}
void QuickEditImpl::slotCancel() {
reinit();
diff --git a/core/pim/todo/quickeditimpl.h b/core/pim/todo/quickeditimpl.h
index 1253f3d..89b94f8 100644
--- a/core/pim/todo/quickeditimpl.h
+++ b/core/pim/todo/quickeditimpl.h
@@ -1,41 +1,41 @@
#ifndef OPIE_QUICK_EDIT_IMPL_H
#define OPIE_QUICK_EDIT_IMPL_H
#include <qpixmap.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include "quickedit.h"
class QLineEdit;
class QLabel;
-class QuickEditImpl : public QPEToolBar, public Todo::QuickEdit {
+class QuickEditImpl : public QToolBar, public Todo::QuickEdit {
Q_OBJECT
public:
QuickEditImpl( QWidget* parent, bool visible);
~QuickEditImpl();
OTodo todo()const;
QWidget* widget();
private slots:
void slotEnter();
void slotPrio();
void slotMore();
void slotCancel();
private:
void reinit();
int m_state;
QLabel* m_lbl;
QLineEdit* m_edit;
QLabel* m_enter;
QLabel* m_more;
QPopupMenu* m_menu;
OTodo m_todo;
bool m_visible;
QPixmap priority1;
QPixmap priority3;
QPixmap priority5;
};
#endif