author | llornkcor <llornkcor> | 2004-07-08 08:37:19 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-07-08 08:37:19 (UTC) |
commit | a53291faf419c90bf22db7cd6d6f26dece2053c1 (patch) (side-by-side diff) | |
tree | d0a5a10621b8705502cc87bde43e18de39042be6 | |
parent | a7b08ae7dbce8675981321828e61c949968d1afe (diff) | |
download | opie-a53291faf419c90bf22db7cd6d6f26dece2053c1.zip opie-a53291faf419c90bf22db7cd6d6f26dece2053c1.tar.gz opie-a53291faf419c90bf22db7cd6d6f26dece2053c1.tar.bz2 |
rework view, fix bookmarking
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 33 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp | 17 |
3 files changed, 33 insertions, 18 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index be920dd..d0af114 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp @@ -163,3 +163,3 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) qDebug("Suppose we open somethin"); - load(qApp->argv()[i]); + if(!load(qApp->argv()[i])) return; } @@ -172,2 +172,3 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) writeConfig(); + QTimer::singleShot( 250, this, SLOT(hideView()) ); } //end init @@ -412,3 +413,3 @@ void Gutenbrowser::ForwardBtn() { Lview->insertLine( s, -1); - odebug << s << oendl; +// odebug << s << oendl; currentLine++; @@ -581,3 +582,3 @@ void Gutenbrowser::BeginBtn() { pageStopArray[i_pageNum ] = currentFilePos; - odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; +// odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; } @@ -652,2 +653,3 @@ void Gutenbrowser::setBookmark() { cfg.writeEntry( "Page Number", QString::number( i_pageNum) ); + cfg.write(); bookmarksMenu->insertItem( title); @@ -693,3 +695,3 @@ void Gutenbrowser::Bookmark( int itemId) { - load(file_name); + if(!load(file_name)) return; @@ -710,3 +712,3 @@ void Gutenbrowser::Bookmark( int itemId) { pageStopArray[i_pageNum ] = currentFilePos; - odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; +// odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; } @@ -749,5 +751,7 @@ bool Gutenbrowser::load( const char *fileName) { odebug << "sizeHint " << sizeHint().height() << " pageSize " << Lview->PageSize() << "" << oendl; +// pointSize = Lview->fontInfo().pointSize(); +// odebug << "sizeHint " << sizeHint().height() << " point size " << pointSize << "" << oendl; if( Lview->PageSize() < 4) { - Lview->setMaximumHeight( sizeHint().height() ); + // Lview->setMaximumHeight( sizeHint().height() ); Lview->setMinimumHeight( sizeHint().height() ); @@ -755,3 +759,3 @@ bool Gutenbrowser::load( const char *fileName) { odebug << "sizeHint " << sizeHint().height() << " point size " << pointSize << "" << oendl; - if(pointSize < 10) + if(pointSize < 15) Lview->setFixedVisibleLines(19); @@ -764,2 +768,3 @@ bool Gutenbrowser::load( const char *fileName) { cfg.writeEntry("Current",fileName); + cfg.write(); currentLine=0; @@ -809,3 +814,3 @@ bool Gutenbrowser::load( const char *fileName) { Lview->setMaxLines(Lview->PageSize()*2); - odebug << "Gulped " << currentLine << "" << oendl; +// odebug << "Gulped " << currentLine << "" << oendl; setCaption(title); @@ -1038,3 +1043,3 @@ void Gutenbrowser::LibraryBtn() { // QCopEnvelope ( "QPE/System", "busy()" ); - load( file_name); + if( !load( file_name)) return; } else { @@ -1082,3 +1087,3 @@ void Gutenbrowser::OpenBtn() { // QCopEnvelope ( "QPE/System", "busy()" ); - load(file_name); + if(!load(file_name)) return; } else { @@ -1780,3 +1785,3 @@ void Gutenbrowser::listClickedSlot( QListBoxItem * index) { if( Lview->isVisible()) - load(file); + if(!load(file)) return; @@ -1808,3 +1813,4 @@ void Gutenbrowser::infoGutenbrowser() { void Gutenbrowser::setDocument(const QString & frozenBoogers) { - this->hide(); +// this->hide(); + qWarning("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSET DOCUMENT\n"); if(showMainList) { @@ -1819,5 +1825,6 @@ void Gutenbrowser::setDocument(const QString & frozenBoogers) { lnk = DocLnk(frozenBoogers); + qWarning("open "+frozenBoogers); // odebug << lnk.file() << oendl; title=lnk.comment(); - load( lnk.file()); + if(!load( lnk.file())) return; this->show(); diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.h b/noncore/apps/opie-gutenbrowser/gutenbrowser.h index acb6e59..2958f01 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.h +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.h @@ -164,2 +164,3 @@ protected: protected slots: + void hideView(); diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp index 9473ba9..c93dbc5 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp @@ -315,3 +315,3 @@ void Gutenbrowser::initView() mainList = new QListBox(this,"mainlist"); - + mainList->hide(); // QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold); @@ -323,6 +323,7 @@ void Gutenbrowser::initView() - if(!showMainList) { - Lview->setText( "\nThis is gutenbrowser for the Sharp Zaurus.\nMake your self at home, sit back, relax and read something great. "); - } else - Lview->hide(); +// if(!showMainList) { +// Lview->setText( "\nThis is gutenbrowser for the Sharp Zaurus.\nMake your self at home, sit back, relax and read something great. "); +// } +// else +// Lview->hide(); @@ -331 +332,7 @@ void Gutenbrowser::initView() } + +void Gutenbrowser::hideView() { +// qWarning("Hide View"); + mainList->show(); + Lview->hide(); +} |