summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/mainwindow.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (side-by-side diff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/opie-write/mainwindow.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/apps/opie-write/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/mainwindow.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp
index 6bb524f..90e1a70 100644
--- a/noncore/apps/opie-write/mainwindow.cpp
+++ b/noncore/apps/opie-write/mainwindow.cpp
@@ -102,50 +102,50 @@ private:
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl )
: QMainWindow( parent, name, fl ),
doc( 0 )
{
setRightJustification(TRUE);
editorStack = new QWidgetStack( this );
fileSelector = new FileSelector( "text/html",
editorStack, "fileselector" );
fileSelector->setCloseVisible( FALSE );
editorStack->addWidget( fileSelector, 0 );
editor = new Qt3::QTextEdit( editorStack );
editor->setTextFormat( Qt::RichText );
editorStack->addWidget( editor, 1 );
setupActions();
QObject::connect( fileSelector, SIGNAL(closeMe()),
this, SLOT(showEditTools()) );
- QObject::connect( fileSelector, SIGNAL(fileSelected(const DocLnk &)),
- this, SLOT(openFile(const DocLnk &)) );
+ QObject::connect( fileSelector, SIGNAL(fileSelected(const DocLnk&)),
+ this, SLOT(openFile(const DocLnk&)) );
QObject::connect( fileSelector, SIGNAL(newSelected(const DocLnk&)),
this, SLOT(newFile(const DocLnk&)) );
if ( fileSelector->fileCount() < 1 )
fileNew();
else {
fileOpen();
}
doConnections( editor );
setCentralWidget( editorStack );
}
MainWindow::~MainWindow()
{
save();
}
void MainWindow::setupActions()
{
setToolBarsMovable(false);
tbMenu = new QToolBar( this );
tbMenu->setHorizontalStretchable( TRUE );
@@ -192,111 +192,111 @@ void MainWindow::setupActions()
connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) );
a->addTo( tbEdit );
a->addTo( edit );
a = new QAction( tr( "Cut" ), Resource::loadIconSet("cut"),
QString::null, 0, this, "editCut" );
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) );
a->addTo( tbEdit );
a->addTo( edit );
a = new QAction( tr( "Paste" ), Resource::loadPixmap("paste"),
QString::null, 0, this, "editPaste" );
connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
a->addTo( tbEdit );
a->addTo( edit );
tbFont = new QToolBar( this );
tbFont->setLabel( "Font Actions" );
tbFont->setHorizontalStretchable(TRUE);
comboFont = new QComboBox( FALSE, tbFont );
FontDatabase db;
QStringList f= db.families();
comboFont->insertStringList( db.families() );
- connect( comboFont, SIGNAL( activated( const QString & ) ),
- this, SLOT( textFamily( const QString & ) ) );
+ connect( comboFont, SIGNAL( activated(const QString&) ),
+ this, SLOT( textFamily(const QString&) ) );
comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) );
comboFont->setMaximumWidth(90);
comboSize = new QComboBox( TRUE, tbFont );
QValueList<int> sizes = db.standardSizes();
QValueList<int>::Iterator it = sizes.begin();
for ( ; it != sizes.end(); ++it )
comboSize->insertItem( QString::number( *it ) );
- connect( comboSize, SIGNAL( activated( const QString & ) ),
- this, SLOT( textSize( const QString & ) ) );
+ connect( comboSize, SIGNAL( activated(const QString&) ),
+ this, SLOT( textSize(const QString&) ) );
comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) );
comboSize->setFixedWidth( 38 );
tbStyle = new QToolBar( this );
tbStyle->setLabel( "Style Actions" );
actionTextBold = new QAction( tr( "Bold" ),
Resource::loadPixmap("bold"),
QString::null, CTRL + Key_B,
this, "textBold" );
connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) );
actionTextBold->addTo( tbStyle );
actionTextBold->setToggleAction( TRUE );
actionTextItalic = new QAction( tr( "Italic" ),
Resource::loadPixmap("italic"),
tr( "&Italic" ), CTRL + Key_I,
this, "textItalic" );
connect( actionTextItalic, SIGNAL( activated() ), this,
SLOT( textItalic() ) );
actionTextItalic->addTo( tbStyle );
actionTextItalic->setToggleAction( TRUE );
actionTextUnderline = new QAction( tr( "Underline" ),
Resource::loadPixmap("underline"),
tr( "&Underline" ), CTRL + Key_U,
this, "textUnderline" );
connect( actionTextUnderline, SIGNAL( activated() ),
this, SLOT( textUnderline() ) );
actionTextUnderline->addTo( tbStyle );
actionTextUnderline->setToggleAction( TRUE );
alignMenu = new ButtonMenu( tbStyle );
alignMenu->insertItem( Resource::loadPixmap("left"), tr("Left"), AlignLeft );
alignMenu->insertItem( Resource::loadPixmap("center"), tr("Center"), AlignCenter );
alignMenu->insertItem( Resource::loadPixmap("right"), tr("Right"), AlignRight );
alignMenu->insertItem( Resource::loadPixmap("opie-write/justify"), tr("Full"), Qt3::AlignJustify );
connect( alignMenu, SIGNAL(activated(int)), this, SLOT(textAlign(int)) );
}
Qt3::QTextEdit *MainWindow::currentEditor() const
{
return editor;
}
void MainWindow::doConnections( Qt3::QTextEdit *e )
{
- connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
- this, SLOT( fontChanged( const QFont & ) ) );
- connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
- this, SLOT( colorChanged( const QColor & ) ) );
- connect( e, SIGNAL( currentAlignmentChanged( int ) ),
- this, SLOT( alignmentChanged( int ) ) );
+ connect( e, SIGNAL( currentFontChanged(const QFont&) ),
+ this, SLOT( fontChanged(const QFont&) ) );
+ connect( e, SIGNAL( currentColorChanged(const QColor&) ),
+ this, SLOT( colorChanged(const QColor&) ) );
+ connect( e, SIGNAL( currentAlignmentChanged(int) ),
+ this, SLOT( alignmentChanged(int) ) );
}
void MainWindow::updateFontSizeCombo( const QFont &f )
{
comboSize->clear();
FontDatabase fdb;
QValueList<int> sizes = fdb.pointSizes( f.family() );
QValueList<int>::Iterator it = sizes.begin();
for ( ; it != sizes.end(); ++it )
comboSize->insertItem( QString::number( *it ) );
}
void MainWindow::editUndo()
{
if ( !currentEditor() )
return;
currentEditor()->undo();
}
void MainWindow::editRedo()
{
if ( !currentEditor() )
return;
currentEditor()->redo();