summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp24
-rw-r--r--noncore/apps/opie-reader/fileBrowser.cpp8
2 files changed, 16 insertions, 16 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index e759249..b0d589e 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -284,117 +284,117 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
mb = new QMenuBar( menubar );
#else
mb = new QMenuBar( menubar );
#endif
//#ifdef USEQPE
QPopupMenu* tmp = new QPopupMenu(mb);
mb->insertItem( geticon( "AppsIcon" ), tmp );
//#else
// QMenuBar* tmp = mb;
//#endif
QPopupMenu *file = new QPopupMenu( mb );
tmp->insertItem( tr( "File" ), file );
QPopupMenu *navigation = new QPopupMenu(mb);
tmp->insertItem( tr( "Navigation" ), navigation );
QPopupMenu *view = new QPopupMenu( mb );
tmp->insertItem( tr( "View" ), view );
QPopupMenu *marks = new QPopupMenu( this );
tmp->insertItem( tr( "Marks" ), marks );
QPopupMenu *settings = new QPopupMenu( this );
tmp->insertItem( tr( "Settings" ), settings );
// addToolBar(menubar, "Menus",QMainWindow::Top);
// addToolBar(fileBar, "Toolbar",QMainWindow::Top);
// QPopupMenu *edit = new QPopupMenu( this );
/*
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 );
*/
editorStack = new QWidgetStack( this );
setCentralWidget( editorStack );
searchVisible = FALSE;
regVisible = FALSE;
m_fontVisible = false;
m_annoWin = new CAnnoEdit(editorStack);
editorStack->addWidget(m_annoWin, get_unique_id());
- connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) );
+ connect( m_annoWin, SIGNAL( finished(const QString&,const QString&) ), this, SLOT( addAnno(const QString&,const QString&) ) );
connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
m_infoWin = new infowin(editorStack);
editorStack->addWidget(m_infoWin, get_unique_id());
connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
m_graphicwin = new GraphicWin(editorStack);
editorStack->addWidget(m_graphicwin, get_unique_id());
connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
// bkmkselector = new QListBox(editorStack, "Bookmarks");
bkmkselector = new CBkmkSelector(editorStack, "Bookmarks");
// connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
editorStack->addWidget( bkmkselector, get_unique_id() );
/*
importSelector = new FileSelector( "*", editorStack, "importselector", false );
- connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) );
+ connect( importSelector, SIGNAL( fileSelected(const DocLnk&) ), this, SLOT( importFile(const DocLnk&) ) );
editorStack->addWidget( importSelector, get_unique_id() );
// don't need the close visible, it is redundant...
importSelector->setCloseVisible( FALSE );
*/
// qDebug("Reading file list");
readfilelist();
reader = new QTReader( editorStack );
reader->bDoUpdates = false;
#ifdef USEQPE
((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
#endif
// qDebug("Reading config");
// Config config( APPDIR );
config.setGroup( "View" );
m_debounce = config.readNumEntry("Debounce", 0);
#ifdef USEQPE
m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false);
#else
m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true);
#endif
reader->bstripcr = config.readBoolEntry( "StripCr", true );
reader->bfulljust = config.readBoolEntry( "FullJust", false );
reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 ));
reader->setlead(config.readNumEntry( "ExtraLead", 0 ));
reader->btextfmt = config.readBoolEntry( "TextFmt", false );
reader->bautofmt = config.readBoolEntry( "AutoFmt", true );
reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
reader->bpeanut = config.readBoolEntry( "Peanut", false );
reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
reader->bdepluck = config.readBoolEntry( "Depluck", false );
reader->bdejpluck = config.readBoolEntry( "Dejpluck", false );
reader->bonespace = config.readBoolEntry( "OneSpace", false );
reader->bunindent = config.readBoolEntry( "Unindent", false );
reader->brepara = config.readBoolEntry( "Repara", false );
reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
reader->bindenter = config.readNumEntry( "Indent", 0 );
reader->m_textsize = config.readNumEntry( "FontSize", 12 );
reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
reader->m_lastfile = config.readEntry( "LastFile", QString::null );
reader->m_lastposn = config.readNumEntry( "LastPosn", 0 );
reader->m_bpagemode = config.readBoolEntry( "PageMode", true );
reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false);
@@ -408,97 +408,97 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
reader->brepalm = config.readBoolEntry( "Repalm", true );
#endif
reader->bremap = config.readBoolEntry( "Remap", true );
reader->bmakebold = config.readBoolEntry( "MakeBold", false );
reader->setContinuous(config.readBoolEntry( "Continuous", true ));
m_targetapp = config.readEntry( "TargetApp", QString::null );
m_targetmsg = config.readEntry( "TargetMsg", QString::null );
#ifdef _SCROLLPIPE
reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null );
reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true );
#endif
m_twoTouch = config.readBoolEntry( "TwoTouch", false);
m_doAnnotation = config.readBoolEntry( "Annotation", false);
m_doDictionary = config.readBoolEntry( "Dictionary", false);
m_doClipboard = config.readBoolEntry( "Clipboard", false);
m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll);
m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone);
m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen);
m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut);
m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn);
m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp);
m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown);
m_leftScroll = config.readBoolEntry("LeftScroll", false);
m_rightScroll = config.readBoolEntry("RightScroll", false);
m_upScroll = config.readBoolEntry("UpScroll", true);
m_downScroll = config.readBoolEntry("DownScroll", true);
m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false);
reader->setBaseSize(config.readNumEntry( "Basesize", 10 ));
#ifndef USEQPE
config.setGroup( "Geometry" );
setGeometry(0,0,
config.readNumEntry( "width", QApplication::desktop()->width()/2 ),
config.readNumEntry( "height", QApplication::desktop()->height()/2 ));
move(
config.readNumEntry( "x", 20 ),
config.readNumEntry( "y", 20 ));
#endif
setTwoTouch(m_twoTouch);
connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) );
connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) );
- connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, const QString&) ) );
+ connect( reader, SIGNAL( OnWordSelected(const QString&,size_t,const QString&) ), this, SLOT( OnWordSelected(const QString&,size_t,const QString&) ) );
connect( reader, SIGNAL( OnURLSelected(const QString&) ), this, SLOT( OnURLSelected(const QString&) ) );
editorStack->addWidget( reader, get_unique_id() );
m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
m_preferences_action->addTo( settings );
m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
m_saveconfig_action->addTo( settings );
m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
m_loadconfig_action->addTo( settings );
m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
m_tidyconfig_action->addTo( settings );
settings->insertSeparator();
m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
m_toolbarprefs_action->addTo( settings );
m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
m_open_action->addTo( file );
m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
m_close_action->addTo( file );
#ifdef _SCRIPT
a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
a->addTo( file );
#endif
/*
a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
a->addTo( file );
a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
a->addTo( filebar() );
a->addTo( edit );
*/
@@ -681,170 +681,170 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
marks->insertSeparator();
m_autogen_action->addTo( marks );
m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
m_clear_action->addTo( marks );
m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
m_save_action->addTo( marks );
m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
marks->insertSeparator();
m_tidy_action->addTo( marks );
m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) );
marks->insertSeparator();
m_startBlock_action->addTo( marks );
m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) );
m_endBlock_action->addTo( marks );
m_bkmkAvail = NULL;
setToolBarsMovable(m_tbmove);
addtoolbars(&config);
pbar = new QProgressBar(this);
pbar->hide();
searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE );
searchBar->setHorizontalStretchable( TRUE );
connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
searchEdit = new QLineEdit( searchBar, "searchEdit" );
// QFont f("unifont", 16 /*, QFont::Bold*/);
// searchEdit->setFont( f );
searchBar->setStretchableWidget( searchEdit );
#ifdef __ISEARCH
- connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
- this, SLOT( search( const QString& ) ) );
+ connect( searchEdit, SIGNAL( textChanged(const QString&) ),
+ this, SLOT( search(const QString&) ) );
#else
- connect( searchEdit, SIGNAL( returnPressed( ) ),
- this, SLOT( search( ) ) );
+ connect( searchEdit, SIGNAL( returnPressed() ),
+ this, SLOT( search() ) );
#endif
QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
a->addTo( searchBar );
a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( searchBar );
searchBar->hide();
regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE );
connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
regBar->setHorizontalStretchable( TRUE );
regEdit = new QLineEdit( regBar, "regEdit" );
// regEdit->setFont( f );
regBar->setStretchableWidget( regEdit );
- connect( regEdit, SIGNAL( returnPressed( ) ),
+ connect( regEdit, SIGNAL( returnPressed() ),
this, SLOT( do_regaction() ) );
a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) );
a->addTo( regBar );
a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) );
a->addTo( regBar );
regBar->hide();
m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE );
m_fontBar->setHorizontalStretchable( TRUE );
// qDebug("Font selector");
m_fontSelector = new QComboBox(false, m_fontBar);
m_fontBar->setStretchableWidget( m_fontSelector );
{
#ifndef USEQPE
QFontDatabase f;
#else
FontDatabase f;
#endif
QStringList flist = f.families();
bool realfont = false;
for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
{
if (reader->m_fontname == *nm)
{
realfont = true;
}
if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm);
}
if (!realfont) reader->m_fontname = flist[0];
} // delete the FontDatabase!!!
- connect( m_fontSelector, SIGNAL( activated(const QString& ) ),
+ connect( m_fontSelector, SIGNAL( activated(const QString&) ),
this, SLOT( do_setfont(const QString&) ) );
- connect( m_fontSelector, SIGNAL( activated(int ) ),
+ connect( m_fontSelector, SIGNAL( activated(int) ),
this, SLOT( do_setencoding(int) ) );
m_fontBar->hide();
m_fontVisible = false;
#ifdef USEMSGS
- connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ),
- this, SLOT( msgHandler(const QCString&, const QByteArray&) ) );
+ connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
+ this, SLOT( msgHandler(const QCString&,const QByteArray&) ) );
#endif
// qDebug("Initing");
reader->init();
// qDebug("Inited");
// m_buttonAction[m_spaceTarget]->setOn(true);
// qDebug("fonting");
do_setfont(reader->m_fontname);
if (!reader->m_lastfile.isEmpty())
{
// qDebug("doclnk");
// doc = new DocLnk(reader->m_lastfile);
// qDebug("doclnk done");
if (pOpenlist != NULL)
{
/*
int ind = 0;
Bkmk* p = (*pOpenlist)[ind];
while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile)
{
p = (*pOpenlist)[++ind];
}
*/
Bkmk* p = NULL;
for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++)
{
p = iter.pContent();
if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile)
{
break;
}
// qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name()));
p = NULL;
}
if (p != NULL)
{
// qDebug("openfrombkmk");
if (!openfrombkmk(p))
showEditTools();
}
else
{
// qDebug("openfile");
openFile( reader->m_lastfile );
}
}
else
{
diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp
index ebd14f3..e1cde6c 100644
--- a/noncore/apps/opie-reader/fileBrowser.cpp
+++ b/noncore/apps/opie-reader/fileBrowser.cpp
@@ -29,100 +29,100 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo
filterspec(QDir::All)
{
// showMaximized();
if ( !name )
setName( "fileBrowser" );
/*
if (parent != NULL)
{
#ifdef OPIE
move(0,0);
resize( parent->width(), parent->height() );
#else
setGeometry(parent->x(), parent->y(), parent->width(), parent->height() );
#endif
}
*/
// showFullScreen();
setCaption(tr( "Browse for file" ) );
filterStr=filter;
buttonOk = new QPushButton( this, "buttonOk" );
buttonOk->setFixedSize( 25, 25 );
buttonOk->setAutoDefault( false );
buttonOk->setText( tr( "/" ) );
buttonShowHidden = new QPushButton( this, "buttonShowHidden" );
// buttonShowHidden->setFixedSize( 50, 25 );
buttonShowHidden->setText( tr( "Hidden" ) );
buttonShowHidden->setAutoDefault( false );
buttonShowHidden->setToggleButton( true );
buttonShowHidden->setOn( false );
dirLabel = new QLabel(this, "DirLabel");
dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak);
dirLabel->setText(currentDir.canonicalPath());
ListView = new QtrListView( this, "ListView" );
ListView->addColumn( tr( "Name" ) );
ListView->setSorting( 2, FALSE);
ListView->addColumn( tr( "Size" ) );
ListView->setSelectionMode(QListView::Single);
ListView->setAllColumnsShowFocus( TRUE );
ListView->setColumnWidthMode(0, QListView::Manual);
ListView->setColumnWidthMode(1, QListView::Manual);
// signals and slots connections
connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) );
- connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
- connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
- connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
- connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
+ connect( ListView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(listDoubleClicked(QListViewItem*)) );
+ connect( ListView, SIGNAL(clicked(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
+ connect( ListView, SIGNAL(OnOKButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
+ connect( ListView, SIGNAL(OnCentreButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) );
QVBoxLayout* grid = new QVBoxLayout(this);
QHBoxLayout* hgrid = new QHBoxLayout(grid);
hgrid->addWidget(dirLabel,1);
hgrid->addWidget(buttonShowHidden);
hgrid->addWidget(buttonOk);
grid->addWidget(ListView,1);
if (allownew)
{
m_filename = new QLineEdit(this);
grid->addWidget(m_filename);
connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() ));
}
else
{
m_filename = NULL;
}
if (QFileInfo(iPath).exists())
{
currentDir.setPath(iPath);
#ifdef _WINDOWS
_chdir(iPath.latin1());
#else
chdir(iPath.latin1());
#endif
}
else
{
currentDir.setPath(QDir::currentDirPath());
chdir(QDir::currentDirPath().latin1());
}
populateList();
if (modal)
QPEApplication::showDialog( this );
}
void fileBrowser::resizeEvent(QResizeEvent* e)
{
ListView->setColumnWidth(1,(ListView->width())/4);
ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1));
}
fileBrowser::~fileBrowser()
{