summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp4
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp9
2 files changed, 2 insertions, 11 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index cc88555..93348f4 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -764,97 +764,97 @@ void TEWidget::mouseMoveEvent(QMouseEvent* ev)
pntSel.y() == iPntSel.y() && pntSel.x() < iPntSel.x() );
swapping = left_not_right != old_left_not_right;
// Find left (left_not_right ? from here : from start)
QPoint left = left_not_right ? here : iPntSel;
i = loc(left.x(),left.y());
selClass = charClass(image[i].c);
while ( left.x() > 0 && charClass(image[i-1].c) == selClass )
{ i--; left.rx()--; }
// Find left (left_not_right ? from start : from here)
QPoint right = left_not_right ? iPntSel : here;
i = loc(right.x(),right.y());
selClass = charClass(image[i].c);
while ( right.x() < columns-1 && charClass(image[i+1].c) == selClass )
{ i++; right.rx()++; }
// Pick which is start (ohere) and which is extension (here)
if ( left_not_right )
{
here = left; ohere = right;
}
else
{
here = right; ohere = left;
}
}
if (here == pntSel && scroll == scrollbar->value()) return; // not moved
if ( word_selection_mode ) {
if ( actSel < 2 || swapping ) {
emit beginSelectionSignal( ohere.x(), ohere.y() );
}
} else if ( actSel < 2 ) {
emit beginSelectionSignal( pntSel.x(), pntSel.y() );
}
actSel = 2; // within selection
pntSel = here;
emit extendSelectionSignal( here.x(), here.y() );
}
void TEWidget::mouseReleaseEvent(QMouseEvent* ev)
{
//printf("release [%d,%d] %d\n",ev->x()/font_w,ev->y()/font_h,ev->button());
if ( ev->button() == LeftButton)
{
- if (QABS(ev->x() - mouse_down_x) < 3
+ if (QABS(ev->x() - mouse_down_x) < 3
&& QABS(ev->y() - mouse_down_y) < 3
&& ev->y() < qApp->desktop()->height()/8) {
emit setFullScreen(false);
}
if ( actSel > 1 ) emit endSelectionSignal(preserve_line_breaks);
preserve_line_breaks = TRUE;
actSel = 0;
//FIXME: emits a release event even if the mouse is
// outside the range. The procedure used in `mouseMoveEvent'
// applies here, too.
QPoint tL = contentsRect().topLeft();
int tLx = tL.x();
int tLy = tL.y();
if (!mouse_marks && !(ev->state() & ShiftButton))
emit mouseSignal( 3, // release
(ev->x()-tLx-blX)/font_w + 1,
(ev->y()-tLy-bY)/font_h + 1 );
releaseMouse();
}
}
void TEWidget::mouseDoubleClickEvent(QMouseEvent* ev)
{
if ( ev->button() != LeftButton) return;
QPoint tL = contentsRect().topLeft();
int tLx = tL.x();
int tLy = tL.y();
QPoint pos = QPoint((ev->x()-tLx-blX)/font_w,(ev->y()-tLy-bY)/font_h);
// pass on double click as two clicks.
if (!mouse_marks && !(ev->state() & ShiftButton))
{
emit mouseSignal( 0, pos.x()+1, pos.y()+1 ); // left button
emit mouseSignal( 3, pos.x()+1, pos.y()+1 ); // release
emit mouseSignal( 0, pos.x()+1, pos.y()+1 ); // left button
return;
}
emit clearSelectionSignal();
QPoint bgnSel = pos;
QPoint endSel = QPoint((ev->x()-tLx-blX)/font_w,(ev->y()-tLy-bY)/font_h);
int i = loc(bgnSel.x(),bgnSel.y());
@@ -1344,86 +1344,86 @@ void TEWidget::dropEvent(QDropEvent* event)
int file_count = 0;
dropText = "";
bool bPopup = true;
if(QUriDrag::decode(event, strlist)) {
if (strlist.count()) {
for(const char* p = strlist.first(); p; p = strlist.next()) {
if(file_count++ > 0) {
dropText += " ";
bPopup = false; // more than one file, don't popup
}
/*
KURL url(p);
if (url.isLocalFile()) {
dropText += url.path(); // local URL : remove protocol
}
else {
dropText += url.prettyURL();
bPopup = false; // a non-local file, don't popup
}
*/
}
if (bPopup)
// m_drop->popup(pos() + event->pos());
m_drop->popup(mapToGlobal(event->pos()));
else
{
if (currentSession) {
currentSession->getEmulation()->sendString(dropText.local8Bit());
}
// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
}
}
}
else if(QTextDrag::decode(event, dropText)) {
// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
if (currentSession) {
currentSession->getEmulation()->sendString(dropText.local8Bit());
}
// Paste it
}
}
#endif
-void TEWidget::drop_menu_activated(int item)
+void TEWidget::drop_menu_activated(int /*item*/)
{
#ifndef QT_NO_DRAGANDDROP
switch (item)
{
case 0: // paste
currentSession->getEmulation()->sendString(dropText.local8Bit());
// KWM::activate((Window)this->winId());
break;
case 1: // cd ...
currentSession->getEmulation()->sendString("cd ");
struct stat statbuf;
if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 )
{
if ( !S_ISDIR(statbuf.st_mode) )
{
/*
KURL url;
url.setPath( dropText );
dropText = url.directory( true, false ); // remove filename
*/
}
}
dropText.replace(QRegExp(" "), "\\ "); // escape spaces
currentSession->getEmulation()->sendString(dropText.local8Bit());
currentSession->getEmulation()->sendString("\n");
// KWM::activate((Window)this->winId());
break;
}
#endif
}
void TEWidget::setWrapAt(int columns)
{
vcolumns = columns;
propagateSize();
update();
}
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index c5df47f..cbea7bd 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -465,105 +465,96 @@ void Konsole::init(const char* _pgm, QStrList & _args)
last_width = fm.width("m");
}
if (sizeMenu == NULL)
{
sizeMenu = new QPopupMenu();
}
int id = sizeMenu->insertItem(QString("%1").arg(size), fontIndex);
sizeMenu->setItemParameter(id, fontIndex);
sizeMenu->connectItem(id, this, SLOT(setFont(int)));
QString name = s + " " + QString::number(size);
fonts.append(new VTFont(name, f, familyNames[j], familyNum, size));
if (familyNames[j] == cfgFontName && size == cfgFontSize)
{
cfont = fontIndex;
}
printf("FOUND: %s family %s size %d\n", name.latin1(), familyNames[j].latin1(), size);
fontIndex++;
}
}
if (sizeMenu)
{
fontList->insertItem(s, sizeMenu, familyNum + 1000);
familyNum++;
}
}
}
if (cfont < 0 || cfont >= (int)fonts.count())
{
cfont = 0;
}
// create terminal emulation framework ////////////////////////////////////
nsessions = 0;
tab = new EKNumTabWidget(this);
// tab->setMargin(tab->margin()-5);
connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
// create terminal toolbar ////////////////////////////////////////////////
setToolBarsMovable( FALSE );
menuToolBar = new QToolBar( this );
menuToolBar->setHorizontalStretchable( TRUE );
QMenuBar *menuBar = new QMenuBar( menuToolBar );
- bool c7xx = false;
- if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600)
- {
- c7xx = true;
- }
- QFont menuFont;
- menuFont.setPointSize(c7xx? 18 : 10);
- qApp->setFont(menuFont, true);
-
setFont(cfont);
configMenu = new QPopupMenu( this);
colorMenu = new QPopupMenu( this);
scrollMenu = new QPopupMenu( this);
editCommandListMenu = new QPopupMenu( this);
configMenu->insertItem(tr("Command List"), editCommandListMenu);
bool listHidden;
cfg.setGroup("Menubar");
if( cfg.readEntry("Hidden","FALSE") == "TRUE")
{
ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" ));
listHidden=TRUE;
}
else
{
ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" ));
listHidden=FALSE;
}
cfg.setGroup("Tabs");
tabMenu = new QPopupMenu(this);
tm_bottom = tabMenu->insertItem(tr("Bottom" ));
tm_top = tabMenu->insertItem(tr("Top"));
tm_hidden = tabMenu->insertItem(tr("Hidden"));
configMenu->insertItem(tr("Tabs"), tabMenu);
tmp=cfg.readEntry("Position","Top");
if(tmp=="Top")
{
tab->setTabPosition(QTabWidget::Top);
tab->getTabBar()->show();
tabPos = tm_top;
}
else if (tmp=="Bottom")
{
tab->setTabPosition(QTabWidget::Bottom);
tab->getTabBar()->show();
tabPos = tm_bottom;
}
else
{
tab->getTabBar()->hide();
tab->setMargin(tab->margin());