summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-12-20 21:29:39 (UTC)
committer llornkcor <llornkcor>2003-12-20 21:29:39 (UTC)
commit8e884631cc002011a9abab37be9223d4a1421ff2 (patch) (unidiff)
treebab42e2a2a305e95a37ce56d52960540240c3c04
parentc7bad76e8d576fc0b6999775c89c724c6fa89158 (diff)
downloadopie-8e884631cc002011a9abab37be9223d4a1421ff2.zip
opie-8e884631cc002011a9abab37be9223d4a1421ff2.tar.gz
opie-8e884631cc002011a9abab37be9223d4a1421ff2.tar.bz2
fix popupmenu position on large screens
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index ecf471d..ac16540 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -564,97 +564,98 @@ void AdvancedFm::showFileMenu() {
564 if ( QFileInfo(fi).isDir() ) { 564 if ( QFileInfo(fi).isDir() ) {
565 m->insertSeparator(); 565 m->insertSeparator();
566 m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() )); 566 m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() ));
567 } else { 567 } else {
568 568
569 if ( app ) 569 if ( app )
570 m->insertItem( app->pixmap(), tr( "Open in " 570 m->insertItem( app->pixmap(), tr( "Open in "
571 + app->name() ), this, SLOT( runThis() ) ); 571 + app->name() ), this, SLOT( runThis() ) );
572 else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this 572 else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this
573 m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) ); 573 m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) );
574 m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); 574 m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) );
575 } 575 }
576 576
577 m->insertItem(tr("Actions"),n); 577 m->insertItem(tr("Actions"),n);
578 n->insertItem( tr( "Make Directory" ), this, SLOT( makeDir() )); 578 n->insertItem( tr( "Make Directory" ), this, SLOT( makeDir() ));
579 579
580 n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); 580 n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
581 581
582 n->insertSeparator(); 582 n->insertSeparator();
583 n->insertItem( tr( "Rename" ), this, SLOT( renameIt() )); 583 n->insertItem( tr( "Rename" ), this, SLOT( renameIt() ));
584 584
585 n->insertItem( tr( "Copy" ), this, SLOT( copy() )); 585 n->insertItem( tr( "Copy" ), this, SLOT( copy() ));
586 n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); 586 n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
587 n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); 587 n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() ));
588 n->insertItem( tr( "Move" ), this, SLOT( move() )); 588 n->insertItem( tr( "Move" ), this, SLOT( move() ));
589 589
590 n->insertSeparator(); 590 n->insertSeparator();
591 n->insertItem( tr( "Delete" ), this, SLOT( doDelete() )); 591 n->insertItem( tr( "Delete" ), this, SLOT( doDelete() ));
592 m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); 592 m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
593 593
594 m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); 594 m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
595 m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); 595 m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
596 596
597 m->insertSeparator(); 597 m->insertSeparator();
598 m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); 598 m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
599 599
600#if defined(QT_QWS_OPIE) 600#if defined(QT_QWS_OPIE)
601 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 601 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
602#endif 602#endif
603 m->setCheckable(TRUE); 603 m->setCheckable(TRUE);
604 if (!b) 604 if (!b)
605 m->setItemChecked(m->idAt(0),TRUE); 605 m->setItemChecked(m->idAt(0),TRUE);
606 else 606 else
607 m->setItemChecked(m->idAt(0),FALSE); 607 m->setItemChecked(m->idAt(0),FALSE);
608 608
609 if(Ir::supported()) 609 if(Ir::supported())
610 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); 610 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
611 m->setFocus(); 611 m->setFocus();
612 m->exec( QPoint( 4,QCursor::pos().y()) ); 612
613 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
613 614
614 if(m) delete m; 615 if(m) delete m;
615} 616}
616 617
617 618
618void AdvancedFm::cancelMenuTimer() { 619void AdvancedFm::cancelMenuTimer() {
619 620
620 if( menuTimer.isActive() ) 621 if( menuTimer.isActive() )
621 menuTimer.stop(); 622 menuTimer.stop();
622} 623}
623 624
624QString AdvancedFm::checkDiskSpace(const QString &path) { 625QString AdvancedFm::checkDiskSpace(const QString &path) {
625 struct statfs fss; 626 struct statfs fss;
626 if ( !statfs( path.latin1(), &fss ) ) { 627 if ( !statfs( path.latin1(), &fss ) ) {
627 int blkSize = fss.f_bsize; 628 int blkSize = fss.f_bsize;
628// int totalBlks = fs.f_blocks; 629// int totalBlks = fs.f_blocks;
629 int availBlks = fss.f_bavail; 630 int availBlks = fss.f_bavail;
630 631
631 long mult = blkSize / 1024; 632 long mult = blkSize / 1024;
632 long div = 1024 / blkSize; 633 long div = 1024 / blkSize;
633 if ( !mult ) mult = 1; 634 if ( !mult ) mult = 1;
634 if ( !div ) div = 1; 635 if ( !div ) div = 1;
635 636
636 637
637 return QString::number(availBlks * mult / div); 638 return QString::number(availBlks * mult / div);
638 } 639 }
639 return ""; 640 return "";
640} 641}
641 642
642void AdvancedFm::addToDocs() { 643void AdvancedFm::addToDocs() {
643 QStringList strListPaths = getPath(); 644 QStringList strListPaths = getPath();
644 QDir *thisDir = CurrentDir(); 645 QDir *thisDir = CurrentDir();
645 646
646 if( strListPaths.count() > 0) { 647 if( strListPaths.count() > 0) {
647 QString curFile; 648 QString curFile;
648 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { 649 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
649 curFile = thisDir->canonicalPath()+"/"+(*it); 650 curFile = thisDir->canonicalPath()+"/"+(*it);
650// qDebug(curFile); 651// qDebug(curFile);
651 QFileInfo fi(curFile); 652 QFileInfo fi(curFile);
652 DocLnk f; 653 DocLnk f;
653// curFile.replace(QRegExp("\\..*"),""); 654// curFile.replace(QRegExp("\\..*"),"");
654 f.setName(fi.baseName() ); 655 f.setName(fi.baseName() );
655 f.setFile( curFile); 656 f.setFile( curFile);
656 f.writeLink(); 657 f.writeLink();
657 } 658 }
658 } 659 }
659} 660}
660 661