summaryrefslogtreecommitdiff
path: root/noncore/apps
Unidiff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp7
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp38
2 files changed, 32 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index feda198..95e619b 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,64 +1,69 @@
1/*************************************************************************** 1/***************************************************************************
2 advancedfmData.cpp 2 advancedfmData.cpp
3 ------------------- 3 -------------------
4** Created: Mon 09-23-2002 13:24:11 4** Created: Mon 09-23-2002 13:24:11
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12#include "advancedfm.h"
13 13
14/* OPIE */ 14/* OPIE */
15#include <opie2/odebug.h> 15#include <opie2/odebug.h>
16#include <opie2/oresource.h> 16#include <opie2/oresource.h>
17#include <qpe/applnk.h> 17#include <qpe/applnk.h>
18#include <qpe/storage.h> 18#include <qpe/storage.h>
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <qpe/menubutton.h> 20#include <qpe/menubutton.h>
21using namespace Opie::Core; 21using namespace Opie::Core;
22using namespace Opie::Ui; 22using namespace Opie::Ui;
23 23
24/* QT */ 24/* QT */
25#include <qframe.h>
25#include <qlayout.h> 26#include <qlayout.h>
26#include <qhbox.h> 27#include <qhbox.h>
27#include <qmenubar.h> 28#include <qmenubar.h>
28#include <qcombobox.h> 29#include <qcombobox.h>
29#include <qtoolbutton.h> 30#include <qtoolbutton.h>
30#include <qlineedit.h> 31#include <qlineedit.h>
31#include <qlistview.h> 32#include <qlistview.h>
32 33
33/* STD */ 34/* STD */
34#include <sys/utsname.h> 35#include <sys/utsname.h>
35 36
36void AdvancedFm::init() { 37void AdvancedFm::init() {
37 b = false; 38 b = false;
38 setCaption( tr( "AdvancedFm" ) ); 39 setCaption( tr( "AdvancedFm" ) );
39 40
40 QVBoxLayout *layout = new QVBoxLayout( this ); 41// QFrame* frame = new QFrame(this);
42// setCentralWidget(frame);
43// QVBoxLayout *layout = new QVBoxLayout( frame );
44
45 QVBoxLayout *layout = new QVBoxLayout( this);
41 layout->setSpacing( 2); 46 layout->setSpacing( 2);
42 layout->setMargin( 0); // squeeze 47 layout->setMargin( 0); // squeeze
43 48
44 QMenuBar *menuBar = new QMenuBar(this); 49 QMenuBar *menuBar = new QMenuBar(this);
45 menuBar->setMargin( 0 ); // squeeze 50 menuBar->setMargin( 0 ); // squeeze
46 fileMenu = new QPopupMenu( this ); 51 fileMenu = new QPopupMenu( this );
47 viewMenu = new QPopupMenu( this ); 52 viewMenu = new QPopupMenu( this );
48// customDirMenu = new QPopupMenu( this ); 53// customDirMenu = new QPopupMenu( this );
49 54
50 layout->addWidget( menuBar ); 55 layout->addWidget( menuBar );
51 56
52 menuBar->insertItem( tr( "File" ), fileMenu); 57 menuBar->insertItem( tr( "File" ), fileMenu);
53 menuBar->insertItem( tr( "View" ), viewMenu); 58 menuBar->insertItem( tr( "View" ), viewMenu);
54 59
55 bool useBigIcon = qApp->desktop()->size().width() > 330; 60 bool useBigIcon = qApp->desktop()->size().width() > 330;
56 61
57 cdUpButton = new QToolButton( 0,"cdUpButton"); 62 cdUpButton = new QToolButton( 0,"cdUpButton");
58 cdUpButton->setUsesBigPixmap( useBigIcon ); 63 cdUpButton->setUsesBigPixmap( useBigIcon );
59 cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); 64 cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
60 cdUpButton->setAutoRaise( true ); 65 cdUpButton->setAutoRaise( true );
61 menuBar->insertItem( cdUpButton ); 66 menuBar->insertItem( cdUpButton );
62 67
63 qpeDirButton= new QToolButton( 0,"QPEButton"); 68 qpeDirButton= new QToolButton( 0,"QPEButton");
64 qpeDirButton->setUsesBigPixmap( useBigIcon ); 69 qpeDirButton->setUsesBigPixmap( useBigIcon );
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 80324eb..ed280aa 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -632,61 +632,75 @@ void AdvancedFm::runCommand() {
632 632
633 } 633 }
634} 634}
635 635
636void AdvancedFm::runCommandStd() { 636void AdvancedFm::runCommandStd() {
637 if( !CurrentView()->currentItem()) return; 637 if( !CurrentView()->currentItem()) return;
638 QString curFile; 638 QString curFile;
639 QDir *thisDir = CurrentDir(); 639 QDir *thisDir = CurrentDir();
640 QListView *thisView = CurrentView(); 640 QListView *thisView = CurrentView();
641 if( thisView->currentItem()) 641 if( thisView->currentItem())
642 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); 642 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0);
643 643
644 InputDialog *fileDlg; 644 InputDialog *fileDlg;
645 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 645 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
646 fileDlg->setInputText(curFile); 646 fileDlg->setInputText(curFile);
647 fileDlg->exec(); 647 fileDlg->exec();
648 648
649 if( fileDlg->result() == 1 ) { 649 if( fileDlg->result() == 1 ) {
650 qApp->processEvents(); 650 qApp->processEvents();
651 startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); 651 startProcess( (const QString)fileDlg->LineEdit1->text().latin1());
652 } 652 }
653} 653}
654 654
655void AdvancedFm::fileStatus() { 655void AdvancedFm::fileStatus() {
656 if( !CurrentView()->currentItem()) return; 656 if( !CurrentView()->currentItem()) return;
657 QString curFile; 657 QString curFile;
658 curFile = CurrentView()->currentItem()->text(0); 658 curFile = CurrentView()->currentItem()->text(0);
659 659 if(QFileInfo("/usr/bin/stat").exists()) {
660 QStringList command; 660 QStringList command;
661 command << "/bin/sh"; 661 command << "/bin/sh";
662 command << "-c"; 662 command << "-c";
663 command << "stat -l "+ curFile; 663 command << "stat -l "+ curFile;
664 Output *outDlg;
665 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
666 QPEApplication::execDialog( outDlg );
667 } else {
668/* struct stat buf;
669 stat( curFile.local8bit(), &buf);
670
671 st_dev dev;
672 st_uid uid;
673 st_gid gid;
674 st_size size;
675 st_atime atime;
676 st_mtime mtime;
677 st_ctime ctime;
678 st_mode mode;
679*/
680 }
664 681
665 Output *outDlg; 682 qApp->processEvents();
666 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
667 QPEApplication::execDialog( outDlg );
668 qApp->processEvents();
669} 683}
670 684
671 685
672void AdvancedFm::mkDir() { 686void AdvancedFm::mkDir() {
673 makeDir(); 687 makeDir();
674} 688}
675 689
676void AdvancedFm::rn() { 690void AdvancedFm::rn() {
677 renameIt(); 691 renameIt();
678} 692}
679 693
680void AdvancedFm::del() { 694void AdvancedFm::del() {
681 doDelete(); 695 doDelete();
682} 696}
683 697
684void AdvancedFm::mkSym() { 698void AdvancedFm::mkSym() {
685 QString cmd; 699 QString cmd;
686 QStringList curFileList = getPath(); 700 QStringList curFileList = getPath();
687 if( curFileList.count() > 0) { 701 if( curFileList.count() > 0) {
688 QDir *thisDir = CurrentDir(); 702 QDir *thisDir = CurrentDir();
689 QDir * thatDir = OtherDir(); 703 QDir * thatDir = OtherDir();
690 704
691 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 705 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
692 706