summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp33
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.h1
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp17
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
@@ -162,5 +162,5 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
for (int i=1;i< qApp->argc();i++) {
qDebug("Suppose we open somethin");
- load(qApp->argv()[i]);
+ if(!load(qApp->argv()[i])) return;
}
} else {
@@ -171,4 +171,5 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
}
writeConfig();
+ QTimer::singleShot( 250, this, SLOT(hideView()) );
} //end init
@@ -411,5 +412,5 @@ void Gutenbrowser::ForwardBtn() {
insertString+=s;
Lview->insertLine( s, -1);
- odebug << s << oendl;
+// odebug << s << oendl;
currentLine++;
}
@@ -580,5 +581,5 @@ void Gutenbrowser::BeginBtn() {
pageStopArray.resize(i_pageNum + 1);
pageStopArray[i_pageNum ] = currentFilePos;
- odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
+// odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
}
// lastPage = i_pageNum;
@@ -651,4 +652,5 @@ void Gutenbrowser::setBookmark() {
cfg.writeEntry( "PagePosition", QString::number( pageStopArray[i_pageNum - 1]));
cfg.writeEntry( "Page Number", QString::number( i_pageNum) );
+ cfg.write();
bookmarksMenu->insertItem( title);
}
@@ -692,5 +694,5 @@ void Gutenbrowser::Bookmark( int itemId) {
Lview->clear();
- load(file_name);
+ if(!load(file_name)) return;
int pageSize= Lview->PageSize();
@@ -709,5 +711,5 @@ void Gutenbrowser::Bookmark( int itemId) {
pageStopArray.resize(i_pageNum + 1);
pageStopArray[i_pageNum ] = currentFilePos;
- odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
+// odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
}
if(currentFilePos == bookmarkPosition)
@@ -748,11 +750,13 @@ bool Gutenbrowser::load( const char *fileName) {
odebug << "Title is already set as "+title << oendl;
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() );
pointSize = Lview->fontInfo().pointSize();
odebug << "sizeHint " << sizeHint().height() << " point size " << pointSize << "" << oendl;
- if(pointSize < 10)
+ if(pointSize < 15)
Lview->setFixedVisibleLines(19);
else
@@ -763,4 +767,5 @@ bool Gutenbrowser::load( const char *fileName) {
cfg.setGroup("General");
cfg.writeEntry("Current",fileName);
+ cfg.write();
currentLine=0;
@@ -808,5 +813,5 @@ bool Gutenbrowser::load( const char *fileName) {
Lview->setMaxLines(Lview->PageSize()*2);
- odebug << "Gulped " << currentLine << "" << oendl;
+// odebug << "Gulped " << currentLine << "" << oendl;
setCaption(title);
Lview->setAutoUpdate( TRUE);
@@ -1037,5 +1042,5 @@ void Gutenbrowser::LibraryBtn() {
setTitle();
// QCopEnvelope ( "QPE/System", "busy()" );
- load( file_name);
+ if( !load( file_name)) return;
} else {
printf("Not opening the file.\n");
@@ -1081,5 +1086,5 @@ void Gutenbrowser::OpenBtn() {
Lview->clear();
// QCopEnvelope ( "QPE/System", "busy()" );
- load(file_name);
+ if(!load(file_name)) return;
} else {
odebug << "file_name is empty!" << oendl;
@@ -1779,5 +1784,5 @@ void Gutenbrowser::listClickedSlot( QListBoxItem * index) {
odebug << "About to load" << oendl;
if( Lview->isVisible())
- load(file);
+ if(!load(file)) return;
config.setGroup( title);
@@ -1807,5 +1812,6 @@ void Gutenbrowser::infoGutenbrowser() {
void Gutenbrowser::setDocument(const QString & frozenBoogers) {
- this->hide();
+// this->hide();
+ qWarning("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSET DOCUMENT\n");
if(showMainList) {
showMainList=FALSE;
@@ -1818,7 +1824,8 @@ void Gutenbrowser::setDocument(const QString & frozenBoogers) {
DocLnk lnk;
lnk = DocLnk(frozenBoogers);
+ qWarning("open "+frozenBoogers);
// odebug << lnk.file() << oendl;
title=lnk.comment();
- load( lnk.file());
+ if(!load( lnk.file())) return;
this->show();
// odebug << title << oendl;
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
@@ -163,4 +163,5 @@ protected:
protected slots:
+ void hideView();
void BackBtn();
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
@@ -314,5 +314,5 @@ void Gutenbrowser::initView()
}
mainList = new QListBox(this,"mainlist");
-
+ mainList->hide();
// QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold);
// mainList->showMaximized();
@@ -322,10 +322,17 @@ void Gutenbrowser::initView()
edits->addWidget(mainList);
- 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();
topLayout->addLayout( edits, 0);
qDebug("end initView");
}
+
+void Gutenbrowser::hideView() {
+// qWarning("Hide View");
+ mainList->show();
+ Lview->hide();
+}