summaryrefslogtreecommitdiff
authorpaule <paule>2007-07-08 08:37:52 (UTC)
committer paule <paule>2007-07-08 08:37:52 (UTC)
commitb07e25cd398620dafb9ce01982267588645d99a9 (patch) (side-by-side diff)
tree41e01245b65ff07efce13743a45eefac7923fdcf
parent4fb748a55cdd77f4bab8dc692ab8ebae62609abe (diff)
downloadopie-b07e25cd398620dafb9ce01982267588645d99a9.zip
opie-b07e25cd398620dafb9ce01982267588645d99a9.tar.gz
opie-b07e25cd398620dafb9ce01982267588645d99a9.tar.bz2
Fix copying unicode block to clipboard. See bug #1766. Patch from polyonymous.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index b985094..4f0f0a1 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -2049,1025 +2049,1025 @@ void QTReaderApp::showprefs()
prefwin->Remap(reader->bremap);
prefwin->Embolden(reader->bmakebold);
prefwin->FullJustify(reader->bfulljust);
// prefwin->Inverse(reader->bInverse);
// prefwin->Negative(reader->bNegative);
prefwin->FixGraphics(reader->m_fontControl.FixGraphics());
prefwin->ParaLead(reader->getextraspace());
prefwin->LineLead(reader->getlead());
prefwin->TopMargin(reader->m_abstopmargin);
prefwin->BottomMargin(reader->m_absbottommargin);
prefwin->LeftMargin(reader->m_absleft_border);
prefwin->RightMargin(reader->m_absright_border);
prefwin->Indent(reader->bindenter);
if (reader->bautofmt)
{
prefwin->Markup(0);
}
else if (reader->btextfmt)
{
prefwin->Markup(2);
}
else if (reader->bstriphtml)
{
prefwin->Markup(3);
}
else if (reader->bpeanut)
{
prefwin->Markup(4);
}
else
{
prefwin->Markup(1);
}
prefwin->Depluck(reader->bdepluck);
prefwin->Dejpluck(reader->bdejpluck);
prefwin->Continuous(reader->m_continuousDocument);
prefwin->DoubleBuffer(reader->m_doubleBuffered);
prefwin->dictApplication(m_targetapp);
prefwin->dictMessage(m_targetmsg);
/*
prefwin->leftScroll(m_leftScroll);
prefwin->rightScroll(m_rightScroll);
prefwin->upScroll(m_upScroll);
prefwin->downScroll(m_downScroll);
*/
prefwin->miscannotation(m_doAnnotation);
prefwin->miscdictionary(m_doDictionary);
prefwin->miscclipboard(m_doClipboard);
prefwin->miscoutput(m_doOutput);
prefwin->SwapMouse(reader->m_swapmouse);
prefwin->Font(reader->m_fontname);
prefwin->gfxsize(reader->getBaseSize());
prefwin->pageoverlap(reader->m_overlap);
prefwin->ideogram(reader->m_bMonoSpaced);
prefwin->encoding(reader->m_encd);
prefwin->ideogramwidth(reader->m_charpc);
prefwin->outcodec(reader->m_outputName);
if (prefwin->exec())
{
// m_debounce = prefwin->Debounce();
reader->brepalm = prefwin->repalm();
reader->bunderlineLink = prefwin->UnderlineLink();
reader->bkern = prefwin->kern();
reader->hyphenate = prefwin->hyphenate();
// reader->buffdoc.setCustomHyphen(prefwin->customhyphen());
reader->m_scrolltype = prefwin->scrolltype();
reader->m_scrollstep = prefwin->scrollstep();
m_scrollcolor = prefwin->scrollcolor();
setscrollcolour();
m_scrollbarcolor = prefwin->minibarcol();
setscrollbarcolour();
m_foreground = prefwin->foreground();
reader->setForeground(getcolour(m_foreground));
m_background = prefwin->background();
reader->setBackground(getcolour(m_background));
m_twoTouch = prefwin->twotouch();
reader->setTwoTouch(m_twoTouch);
m_touch_action->setOn(m_twoTouch);
reader->bstripcr = prefwin->StripCR();
reader->bNoInlineTables = !prefwin->InlineTables();
reader->bdehyphen = prefwin->Dehyphen();
reader->bonespace = prefwin->SingleSpace();
reader->bunindent = prefwin->Unindent();
reader->brepara = prefwin->Reparagraph();
reader->bdblspce = prefwin->DoubleSpace();
reader->bremap = prefwin->Remap();
reader->bmakebold = prefwin->Embolden();
reader->bfulljust = prefwin->FullJustify();
// if (reader->bInverse != prefwin->Inverse()) reader->setInverse(prefwin->Inverse());
// if (reader->bNegative != prefwin->Negative()) reader->setNegative();
reader->m_fontControl.FixGraphics(prefwin->FixGraphics());
reader->setextraspace(prefwin->ParaLead());
reader->setlead(prefwin->LineLead());
reader->m_abstopmargin = prefwin->TopMargin();
reader->m_absbottommargin = prefwin->BottomMargin();
reader->m_absleft_border = prefwin->LeftMargin();
reader->m_absright_border = prefwin->RightMargin();
reader->bindenter = prefwin->Indent();
reader->bautofmt = reader->btextfmt = reader->bstriphtml = reader->bpeanut = false;
switch (prefwin->Markup())
{
case 0:
reader->bautofmt = true;
break;
case 1:
break;
case 2:
reader->btextfmt = true;
break;
case 3:
reader->bstriphtml = true;
break;
case 4:
reader->bpeanut = true;
break;
default:
qDebug("Format out of range");
}
reader->bdepluck = prefwin->Depluck();
reader->bdejpluck = prefwin->Dejpluck();
reader->setContinuous(prefwin->Continuous());
reader->setDoubleBuffer(prefwin->DoubleBuffer());
/*
m_leftScroll = prefwin->leftScroll();
m_rightScroll = prefwin->rightScroll();
m_upScroll = prefwin->upScroll();
m_downScroll = prefwin->downScroll();
*/
m_targetapp = prefwin->dictApplication();
m_targetmsg = prefwin->dictMessage();
m_doAnnotation = prefwin->miscannotation();
m_doDictionary = prefwin->miscdictionary();
m_doClipboard = prefwin->miscclipboard();
m_doOutput = prefwin->miscoutput();
reader->m_swapmouse = prefwin->SwapMouse();
reader->setBaseSize(prefwin->gfxsize());
reader->m_overlap = prefwin->pageoverlap();
reader->m_bMonoSpaced = prefwin->ideogram();
m_setmono_action->setOn(reader->m_bMonoSpaced);
reader->m_encd = prefwin->encoding();
reader->m_charpc = prefwin->ideogramwidth();
if (
reader->m_fontname != prefwin->Font()
||
m_propogatefontchange != prefwin->propfontchange())
{
m_propogatefontchange = prefwin->propfontchange();
setfontHelper(prefwin->Font());
}
if (m_bgtype != (bground)prefwin->bgtype())
{
m_bgtype = (bground)prefwin->bgtype();
setBackgroundBitmap();
}
qDebug("OutCodec:%s", (const char*)prefwin->outcodec());
if (reader->m_outputName != prefwin->outcodec())
{
if (reader->m_output != NULL)
{
QMessageBox::warning(this, PROGNAME, "Change of output codec\nrequires a restart");
}
reader->m_outputName = prefwin->outcodec();
}
delete prefwin;
reader->setfilter(reader->getfilter());
reader->refresh();
}
else
{
delete prefwin;
}
}
void QTReaderApp::showtoolbarprefs()
{
#ifdef USEQPE
CBarPrefs* prefwin = new CBarPrefs(APPDIR, !m_bFloatingDialog, this);
#else
QFileInfo fi;
QDir d = QDir::home(); // "/"
if ( !d.cd(APPDIR) )
{ // "/tmp"
qWarning( "Cannot find the \"~/%s\" directory", APPDIR );
d = QDir::home();
d.mkdir(APPDIR);
d.cd(APPDIR);
}
fi.setFile(d, INIFILE);
CBarPrefs* prefwin = new CBarPrefs(fi.absFilePath(), !m_bFloatingDialog, this);
#endif
prefwin->tbpolicy(m_tbpolsave);
prefwin->tbposition(m_tbposition-2);
prefwin->tbmovable(m_tbmovesave);
prefwin->floating(m_bFloatingDialog);
prefwin->qtscroll(m_qtscroll);
prefwin->localscroll(m_localscroll);
if (prefwin->exec())
{
m_bFloatingDialog = prefwin->floating();
if (
m_tbpolsave != (ToolbarPolicy)prefwin->tbpolicy()
||
m_tbposition != (ToolBarDock)(prefwin->tbposition()+2)
||
m_tbmovesave != prefwin->tbmovable()
||
m_qtscroll != prefwin->qtscroll()
// ||
// m_localscrollbar != prefwin->scrollonleft()
)
{
QMessageBox::warning(this, PROGNAME, "Some changes won't take effect\nuntil the next time the\napplication is started");
}
m_tbpolsave = (ToolbarPolicy)prefwin->tbpolicy();
m_tbposition = (ToolBarDock)(prefwin->tbposition()+2);
m_tbmovesave = prefwin->tbmovable();
reader->m_scrollpos = m_localscroll = prefwin->localscroll();
if (m_qtscroll != prefwin->qtscroll())
{
m_qtscroll = prefwin->qtscroll();
setrotated(reader->m_rotated);
}
if (m_scrollbar == NULL || m_scrollbar->isHidden())
{
reader->m_scrollpos = m_localscroll;
}
else
{
reader->m_scrollpos = (m_qtscroll == 0) ? m_localscroll : 0;
}
bool isChanged = prefwin->isChanged();
delete prefwin;
#ifdef USEQPE
Config config( APPDIR );
#else
QFileInfo fi;
QDir d = QDir::home(); // "/"
if ( !d.cd(APPDIR) )
{ // "/tmp"
qWarning( "Cannot find the \"~/%s\" directory", APPDIR );
d = QDir::home();
d.mkdir(APPDIR);
d.cd(APPDIR);
}
fi.setFile(d, INIFILE);
Config config( fi.absFilePath() );
#endif
if (isChanged) addtoolbars(&config);
}
else
{
delete prefwin;
}
}
void QTReaderApp::showinfo()
{
unsigned long ds, fs, ts, pl, dl;
if (reader->empty())
{
QMessageBox::information(this, PROGNAME, "No file loaded", 1);
}
else
{
reader->sizes(fs,ts);
ds = reader->buffdoc.endSection() - reader->buffdoc.startSection();
pl = reader->pagelocate();
dl = pl - reader->buffdoc.startSection();
m_infoWin->setFileSize(fs);
m_infoWin->setTextSize(ts);
if (fs > UINT_MAX/100)
{
unsigned long t1 = (ts+50)/100;
m_infoWin->setRatio(100-(fs + (t1 >> 1))/t1);
}
else
{
m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts);
}
m_infoWin->setLocation(pl);
if (pl > UINT_MAX/100)
{
unsigned long t1 = (ts+50)/100;
m_infoWin->setRead((pl + (t1 >> 1))/t1);
}
else
{
m_infoWin->setRead((100*pl + (ts >> 1))/ts);
}
m_infoWin->setDocSize(ds);
m_infoWin->setDocLocation(dl);
if (dl > UINT_MAX/100)
{
unsigned long d1 = (ds+50)/100;
m_infoWin->setDocRead((dl + (d1 >> 1))/d1);
}
else
{
m_infoWin->setDocRead((100*dl + (ds >> 1))/ds);
}
m_infoWin->setZoom(reader->m_fontControl.currentsize()*10);
m_infoWin->setAbout(QString("\nApplication (c) Tim Wentford\n")+reader->about());
editorStack->raiseWidget( m_infoWin );
hidetoolbars();
m_infoWin->setFocus();
}
}
void QTReaderApp::addAnno(const QString& name, const QString& text, size_t posn, size_t posn2)
{
if (pBkmklist == NULL) reader->pBkmklist = pBkmklist = new CList<Bkmk>;
#ifdef _UNICODE
CBuffer buff(name.length()+1);
int i;
for (i = 0; i < name.length(); i++)
{
buff[i] = name[i].unicode();
}
buff[i] = 0;
CBuffer buff2(text.length()+1);
for (i = 0; i < text.length(); i++)
{
buff2[i] = text[i].unicode();
}
buff2[i] = 0;
Bkmk b(buff.data(), buff2.data(), posn, posn2);
QColor c = m_annoWin->getColor();
int red,green,blue;
c.rgb(&red, &green, &blue);
b.red(red);
b.green(green);
b.blue(blue);
pBkmklist->push_front(b);
#else
pBkmklist->push_front(Bkmk((const tchar*)text,posn));
#endif
m_fBkmksChanged = true;
pBkmklist->sort();
}
void QTReaderApp::addAnno(const QString& name, const QString& text)
{
if (m_annoIsEditing)
{
if (name.isEmpty())
{
QMessageBox::information(this, PROGNAME, "Need a name for the bookmark\nPlease try again", 1);
}
else
{
addAnno(name, text, m_annoWin->getPosn(), m_annoWin->getPosn2());
}
showEditTools();
}
else
{
if (m_annoWin->edited())
{
CBuffer buff(text.length()+1);
int i;
for (i = 0; i < text.length(); i++)
{
buff[i] = text[i].unicode();
}
buff[i] = 0;
m_fBkmksChanged = true;
m_anno->setAnno(buff.data());
}
QColor c = m_annoWin->getColor();
int red,green,blue;
c.rgb(&red, &green, &blue);
m_anno->red(red);
m_anno->green(green);
m_anno->blue(blue);
bool found = findNextBookmark(m_anno->value()+1);
if (found)
{
m_annoWin->setName(toQString(m_anno->name()));
m_annoWin->setAnno(toQString(m_anno->anno()));
m_annoWin->setColor(QColor(m_anno->red(), m_anno->green(), m_anno->blue()));
}
else
{
showEditTools();
}
}
}
bool QTReaderApp::findNextBookmark(size_t start)
{
bool found = false;
for (CList<Bkmk>::iterator iter = pBkmklist->begin(); iter != pBkmklist->end(); iter++)
{
if (iter->value() >= start)
{
if (iter->value() < reader->locate())
{
found = true;
m_anno = iter.pContent();
}
break;
}
}
return found;
}
void QTReaderApp::addanno()
{
if (reader->empty())
{
QMessageBox::information(this, PROGNAME, "No file loaded", 1);
}
else
{
m_annoWin->setName("");
m_annoWin->setAnno("");
m_annoWin->setPosn(reader->pagelocate());
m_annoIsEditing = true;
editorStack->raiseWidget( m_annoWin );
hidetoolbars();
#ifdef USEQPE
Global::showInputMethod();
#endif
m_annoWin->setFocus();
}
}
void QTReaderApp::infoClose()
{
m_debounce = m_buttonprefs->Debounce();
if (m_kmapchanged)
{
m_kmapchanged = false;
#ifndef USEQPE
QDir d = QDir::home(); // "/"
d.cd(APPDIR);
QFileInfo fi(d, ".keymap");
FILE* f = fopen((const char *)fi.absFilePath(), "w");
#else /* USEQPE */
FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "w");
#endif /* USEQPE */
if (f != NULL)
{
uint cnt = KEYMAPVERSION;
fwrite(&cnt, sizeof(cnt), 1, f);
cnt = kmap.count();
fwrite(&cnt, sizeof(cnt), 1, f);
for (QMap<orKey,int>::Iterator i = kmap.begin(); i != kmap.end(); i++)
{
orKey key = i.key();
int data = i.data();
fwrite(&key, sizeof(key), 1, f);
fwrite(&data, sizeof(data), 1, f);
qDebug("Saved %s as %u", (const char*)key.text(), data);
}
fclose(f);
}
}
showEditTools();
}
/*
void QTReaderApp::fileRevert()
{
clear();
fileOpen();
}
void QTReaderApp::editCut()
{
#ifndef QT_NO_CLIPBOARD
editor->cut();
#endif
}
*/
void QTReaderApp::editMark()
{
m_savedpos = reader->pagelocate();
}
void QTReaderApp::editCopy()
{
QClipboard* cb = QApplication::clipboard();
QString text;
int ch;
unsigned long currentpos = reader->pagelocate();
unsigned long endpos = reader->locate();
if (m_savedpos == 0xffffffff)
{
m_savedpos = currentpos;
}
reader->jumpto(m_savedpos);
while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF)
{
- text += ch;
+ text += QChar(ch);
}
cb->setText(text);
reader->locate(currentpos);
m_savedpos = 0xffffffff;
}
void QTReaderApp::gotoStart()
{
reader->locate(reader->buffdoc.startSection());
}
void QTReaderApp::gotoEnd()
{
reader->dopageup(reader->buffdoc.endSection());
}
void QTReaderApp::pageup()
{
reader->NavUp();
}
void QTReaderApp::pagedn()
{
reader->NavDown();
}
void QTReaderApp::pagemode(bool _b)
{
reader->setpagemode(_b);
}
/*
void QTReaderApp::setspacing()
{
m_nRegAction = cMonoSpace;
char lcn[20];
sprintf(lcn, "%lu", reader->m_charpc);
regEdit->setText(lcn);
do_regedit();
}
*/
void QTReaderApp::settarget()
{
m_nRegAction = cSetTarget;
QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp)
+ "/"
+ ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg);
regEdit->setText(text);
do_regedit();
}
/*
void QTReaderApp::do_mono(const QString& lcn)
{
bool ok;
unsigned long ulcn = lcn.toULong(&ok);
if (ok)
{
reader->m_charpc = ulcn;
reader->setfont();
reader->refresh();
// reader->setmono(true);
}
else
QMessageBox::information(this, PROGNAME, "Must be a number");
}
*/
/*
void QTReaderApp::editPaste()
{
#ifndef QT_NO_CLIPBOARD
editor->paste();
#endif
}
*/
void QTReaderApp::editFind()
{
searchStart = reader->pagelocate();
#ifdef __ISEARCH
searchStack = new QStack<searchrecord>;
#endif
#ifdef USEQPE
Global::showInputMethod();
#endif
searchBar->show();
searchVisible = TRUE;
searchEdit->setFocus();
#ifdef __ISEARCH
searchStack->push(new searchrecord("",reader->pagelocate()));
#endif
}
void QTReaderApp::findNext()
{
// // qDebug("findNext called\n");
#ifdef __ISEARCH
QString arg = searchEdit->text();
#else
QRegExp arg = searchEdit->text();
#endif
CDrawBuffer test(&(reader->m_fontControl));
size_t start = reader->pagelocate();
reader->jumpto(start);
reader->getline(&test);
dosearch(start, test, arg);
}
void QTReaderApp::findClose()
{
searchVisible = FALSE;
searchEdit->setText("");
#ifdef USEQPE
Global::hideInputMethod();
#endif
searchBar->hide();
#ifdef __ISEARCH
// searchStack = new QStack<searchrecord>;
while (!searchStack->isEmpty())
{
delete searchStack->pop();
}
delete searchStack;
#endif
reader->setFocus();
}
void QTReaderApp::regClose()
{
regVisible = FALSE;
regEdit->setText("");
regBar->hide();
#ifdef USEQPE
Global::hideInputMethod();
#endif
reader->setFocus();
}
#ifdef __ISEARCH
bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QString& arg)
#else
bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg)
#endif
{
bool ret = true;
unsigned long fs, ts;
reader->sizes(fs,ts);
size_t pos = reader->locate();
pbar->setGeometry(searchBar->x(),searchBar->y(),searchBar->width(), searchBar->height());
pbar->show();
pbar->raise();
pbar->reset();
int offset;
int lastpc = (100*pos)/ts;
pbar->setProgress(lastpc);
// qApp->processEvents();
if (reader->buffdoc.getpara(test) >= 0)
{
reader->setFocus();
#ifdef __ISEARCH
while (strstr(test.data(),(const tchar*)arg) == NULL)
#else
#ifdef _UNICODE
while ((offset = arg.match(toQString(test.data()))) == -1)
#else
while (arg.match(test.data()) == -1)
#endif
#endif
{
pos = reader->locate();
int pc = (100*pos)/ts;
if (pc != lastpc)
{
pbar->setProgress(pc);
qApp->processEvents();
reader->setFocus();
lastpc = pc;
}
if (reader->buffdoc.getpara(test) < 0)
{
if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2)
pos = searchStart;
else
pos = start;
findClose();
pbar->hide();
reader->locate(pos);
return false;
}
}
// qDebug("Found it at %u:%u", pos, offset);
pbar->hide();
// qDebug("Hid");
reader->locate(pos+offset);
// qDebug("Loacted");
// qDebug("page up");
ret = true;
}
else
{
if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2)
pos = searchStart;
else
pos = start;
ret = false;
findClose();
}
return ret;
}
#ifdef __ISEARCH
void QTReaderApp::search(const QString & arg)
{
searchrecord* ss = searchStack->top();
CBuffer test;
size_t start = reader->pagelocate();
bool haspopped = false;
while (arg.left(ss->s.length()) != ss->s)
{
haspopped = true;
start = ss->pos;
// reader->locate(start);
searchStack->pop();
delete ss;
}
if (haspopped) reader->locate(start);
/*
if (arg.length() < ss->len)
{
start = ss->pos;
reader->locate(start);
searchStack->pop();
delete ss;
}
*/
else
{
start = reader->pagelocate();
reader->jumpto(start);
searchStack->push(new searchrecord(arg,start));
}
dosearch(start, test, arg);
}
#else
void QTReaderApp::search()
{
findNext();
}
#endif
void QTReaderApp::openFile( const QString &f, unsigned int loc )
{
// qDebug("File:%s", (const char*)f);
// openFile(DocLnk(f));
//}
//
//void QTReaderApp::openFile( const DocLnk &f )
//{
clear();
QFileInfo fm(f);
if ( fm.exists() )
{
// QMessageBox::information(0, "Progress", "Calling fileNew()");
#ifdef USEQPE
if (fm.extension( FALSE ) == "desktop")
{
DocLnk d(f);
QFileInfo fnew(d.file());
fm = fnew;
if (!fm.exists()) return;
}
#endif
clear();
reader->setText(fm.baseName(), fm.absFilePath(), loc);
m_loadedconfig = readconfig(APPDIR "/configs", reader->m_string, false);
qDebug("Showing tools");
showEditTools();
qDebug("Shown tools");
readbkmks();
qDebug("read markss");
m_savedpos = 0xffffffff;
}
else
{
QString msg = f;
msg += "\nFile does not exist";
QMessageBox::information(this, PROGNAME, msg);
reader->m_lastfile = QString::null;
}
}
/*
void QTReaderApp::resizeEvent(QResizeEvent* e)
{
if (m_fullscreen)
{
showNormal();
showFullScreen();
}
}
*/
void QTReaderApp::handlekey(QKeyEvent* e)
{
// qDebug("Keypress event");
timeb now;
ftime(&now);
unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm;
if (etime < m_debounce)
{
return;
}
switch(e->key())
{
case Key_Escape:
qDebug("escape event");
if (m_disableesckey)
{
m_disableesckey = false;
}
else
{
m_bcloseDisabled = true;
if (m_fullscreen)
{
m_actFullscreen->setOn(false);
e->accept();
}
else
{
// qDebug("escape action");
doAction(e);
}
}
break;
/*
case Key_Left:
{
if (reader->m_autoScroll)
{
reader->reduceScroll();
}
else
{
doAction(e);
}
}
break;
case Key_Right:
{
if (reader->m_autoScroll)
{
reader->increaseScroll();
}
else
{
doAction(e);
}
}
break;
case Key_Up:
{
if (reader->m_autoScroll)
{
reader->increaseScroll();
}
else
{
doAction(e);
}
}
break;
case Key_Down:
{
if (reader->m_autoScroll)
{
reader->reduceScroll();
}
else
{
doAction(e);
}
}
break;
*/
default:
{
doAction(e);
}
/*
QString msg("Key press was:");
QString key;
msg += key.setNum(e->key());
QMessageBox::information(this, PROGNAME, msg);
*/
}
ftime(&m_lastkeytime);
}
#if defined(USEQPE) && defined(USENEWFULLSCREEN)
void QTReaderApp::focusInEvent(QFocusEvent *)
{
if (m_usenewfullscreen && m_fullscreen && (editorStack->visibleWidget() == reader))
{
m_usenewfullscreen = false;
reader->bDoUpdates = false;
showEditTools();
reader->bDoUpdates = true;
reader->update();
m_usenewfullscreen = true;
}
}
void QTReaderApp::resizeEvent(QResizeEvent *)
{
if (m_usenewfullscreen && m_fullscreen && (editorStack->visibleWidget() == reader))
{
m_usenewfullscreen = false;
reader->bDoUpdates = false;
showEditTools();
reader->bDoUpdates = true;
reader->update();
m_usenewfullscreen = true;
}
}
#endif
void QTReaderApp::showEditTools()
{
// if ( !doc )
// close();
if (m_fullscreen)
{
#if defined(USEQPE)
if (menubar != NULL) menubar->hide();
#endif
if (fileBar != NULL) fileBar->hide();
if (viewBar != NULL) viewBar->hide();
if (navBar != NULL) navBar->hide();
if (markBar != NULL) markBar->hide();
if (m_prog != NULL)
{
// qDebug("Hiding status");
m_prog->hide();
}
searchBar->hide();
regBar->hide();
#ifdef USEQPE
Global::hideInputMethod();
#endif
if (m_scrollbar != NULL) m_scrollbar->hide();
m_fontBar->hide();
// showNormal();
showFullScreen();
}
else
{
// qDebug("him");
#ifdef USEQPE
Global::hideInputMethod();
#endif
// qDebug("eb");
if (m_scrollbar != NULL)
{
if (m_scrollishidden)
{
m_scrollbar->hide();
}
else
{
m_scrollbar->show();
}
}
if (!m_hidebars)
{
#if defined(USEQPE)
menubar->show();
#endif
if (fileBar != NULL) fileBar->show();
if (viewBar != NULL) viewBar->show();
if (navBar != NULL) navBar->show();
if (markBar != NULL) markBar->show();
if (m_prog != NULL && !m_statusishidden)
{
// qDebug("Showing status");
m_prog->show();
// qDebug("Shown status");
}
// qDebug("Showing mb");
mb->show();
}
if ( searchVisible )
{
#ifdef USEQPE
Global::showInputMethod();
#endif
searchBar->show();
}
if ( regVisible )
{
#ifdef USEQPE
Global::showInputMethod();
#endif
regBar->show();
}
if (m_fontVisible) m_fontBar->show();
// qDebug("sn");
showNormal();
// qDebug("sm");
#if defined(USEQPE) && !defined(SIMPAD)
showMaximized();