author | llornkcor <llornkcor> | 2003-03-26 02:29:46 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-03-26 02:29:46 (UTC) |
commit | 114dc0018c29cb899f10bbbe4eb84db1482f9598 (patch) (unidiff) | |
tree | 5f090b026bcb6cafe39b4650530fe0a5cac16bdc | |
parent | 445c957aeddcea7ee0b83657e00987103a6d35b0 (diff) | |
download | opie-114dc0018c29cb899f10bbbe4eb84db1482f9598.zip opie-114dc0018c29cb899f10bbbe4eb84db1482f9598.tar.gz opie-114dc0018c29cb899f10bbbe4eb84db1482f9598.tar.bz2 |
change to UnknownDocument icon
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 10 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 7c83223..db365ca 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -65,48 +65,53 @@ static int log_progress(netbuf *, int xfered, void *) | |||
65 | // int fsz = *(int *)arg; | 65 | // int fsz = *(int *)arg; |
66 | // int pct = (xfered * 100) / fsz; | 66 | // int pct = (xfered * 100) / fsz; |
67 | // printf("%3d%%\r", pct); | 67 | // printf("%3d%%\r", pct); |
68 | // fflush(stdout); | 68 | // fflush(stdout); |
69 | ProgressBar->setProgress(xfered); | 69 | ProgressBar->setProgress(xfered); |
70 | qApp->processEvents(); | 70 | qApp->processEvents(); |
71 | return 1; | 71 | return 1; |
72 | } | 72 | } |
73 | 73 | ||
74 | OpieFtp::OpieFtp( ) | 74 | OpieFtp::OpieFtp( ) |
75 | : QMainWindow( ) | 75 | : QMainWindow( ) |
76 | { | 76 | { |
77 | setCaption( tr( "OpieFtp" ) ); | 77 | setCaption( tr( "OpieFtp" ) ); |
78 | fuckeduphack=FALSE; | 78 | fuckeduphack=FALSE; |
79 | QGridLayout *layout = new QGridLayout( this ); | 79 | QGridLayout *layout = new QGridLayout( this ); |
80 | layout->setSpacing( 2); | 80 | layout->setSpacing( 2); |
81 | layout->setMargin( 2); | 81 | layout->setMargin( 2); |
82 | 82 | ||
83 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 83 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
84 | 84 | ||
85 | QPEMenuBar *menuBar = new QPEMenuBar(this); | 85 | QPEMenuBar *menuBar = new QPEMenuBar(this); |
86 | // QPEToolBar *menuBar = new QPEToolBar(this); | 86 | // QPEToolBar *menuBar = new QPEToolBar(this); |
87 | // menuBar->setHorizontalStretchable( TRUE ); | 87 | // menuBar->setHorizontalStretchable( TRUE ); |
88 | 88 | ||
89 | QWMatrix matrix; | ||
90 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); | ||
91 | matrix.scale( .4, .4); | ||
92 | unknownXpm = pix.xForm(matrix); | ||
93 | |||
89 | connectionMenu = new QPopupMenu( this ); | 94 | connectionMenu = new QPopupMenu( this ); |
90 | localMenu = new QPopupMenu( this ); | 95 | localMenu = new QPopupMenu( this ); |
91 | remoteMenu = new QPopupMenu( this ); | 96 | remoteMenu = new QPopupMenu( this ); |
92 | tabMenu = new QPopupMenu( this ); | 97 | tabMenu = new QPopupMenu( this ); |
93 | 98 | ||
94 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); | 99 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); |
95 | 100 | ||
96 | menuBar->insertItem( tr( "Connection" ), connectionMenu); | 101 | menuBar->insertItem( tr( "Connection" ), connectionMenu); |
97 | menuBar->insertItem( tr( "Local" ), localMenu); | 102 | menuBar->insertItem( tr( "Local" ), localMenu); |
98 | menuBar->insertItem( tr( "Remote" ), remoteMenu); | 103 | menuBar->insertItem( tr( "Remote" ), remoteMenu); |
99 | menuBar->insertItem( tr( "View" ), tabMenu); | 104 | menuBar->insertItem( tr( "View" ), tabMenu); |
100 | 105 | ||
101 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 106 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
102 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 107 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
103 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); | 108 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); |
104 | 109 | ||
105 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 110 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
106 | localMenu->insertSeparator(); | 111 | localMenu->insertSeparator(); |
107 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); | 112 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); |
108 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 113 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
109 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 114 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
110 | localMenu->insertSeparator(); | 115 | localMenu->insertSeparator(); |
111 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 116 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
112 | localMenu->setCheckable(TRUE); | 117 | localMenu->setCheckable(TRUE); |
@@ -667,61 +672,60 @@ void OpieFtp::populateLocalView() | |||
667 | fileDate= fi->lastModified().toString(); | 672 | fileDate= fi->lastModified().toString(); |
668 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { | 673 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { |
669 | fileL+="/"; | 674 | fileL+="/"; |
670 | isDir=TRUE; | 675 | isDir=TRUE; |
671 | // qDebug( fileL); | 676 | // qDebug( fileL); |
672 | } | 677 | } |
673 | } | 678 | } |
674 | if(fileL !="./" && fi->exists()) { | 679 | if(fileL !="./" && fi->exists()) { |
675 | item = new QListViewItem( Local_View,fileL, fileDate, fileS ); | 680 | item = new QListViewItem( Local_View,fileL, fileDate, fileS ); |
676 | QPixmap pm; | 681 | QPixmap pm; |
677 | 682 | ||
678 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 683 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
679 | if( !QDir( fi->filePath() ).isReadable()) | 684 | if( !QDir( fi->filePath() ).isReadable()) |
680 | pm = Resource::loadPixmap( "lockedfolder" ); | 685 | pm = Resource::loadPixmap( "lockedfolder" ); |
681 | else | 686 | else |
682 | pm= Resource::loadPixmap( "folder" ); | 687 | pm= Resource::loadPixmap( "folder" ); |
683 | item->setPixmap( 0,pm ); | 688 | item->setPixmap( 0,pm ); |
684 | } else { | 689 | } else { |
685 | if( !fi->isReadable() ) | 690 | if( !fi->isReadable() ) |
686 | pm = Resource::loadPixmap( "locked" ); | 691 | pm = Resource::loadPixmap( "locked" ); |
687 | else { | 692 | else { |
688 | MimeType mt(fi->filePath()); | 693 | MimeType mt(fi->filePath()); |
689 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 694 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
690 | if(pm.isNull()) | 695 | if(pm.isNull()) |
691 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 696 | pm = unknownXpm; |
692 | item->setPixmap( 0,pm); | ||
693 | } | 697 | } |
694 | } | 698 | } |
695 | if( fileL.find("->",0,TRUE) != -1) { | 699 | if( fileL.find("->",0,TRUE) != -1) { |
696 | // overlay link image | 700 | // overlay link image |
697 | pm= Resource::loadPixmap( "folder" ); | 701 | pm= Resource::loadPixmap( "folder" ); |
698 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 702 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
699 | QPainter painter( &pm ); | 703 | QPainter painter( &pm ); |
700 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 704 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
701 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 705 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
702 | item->setPixmap( 0, pm); | ||
703 | } | 706 | } |
707 | item->setPixmap( 0,pm); | ||
704 | } | 708 | } |
705 | isDir=FALSE; | 709 | isDir=FALSE; |
706 | ++it; | 710 | ++it; |
707 | } | 711 | } |
708 | Local_View->setSorting( 3,FALSE); | 712 | Local_View->setSorting( 3,FALSE); |
709 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); | 713 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); |
710 | fillCombo( (const QString &)currentDir); | 714 | fillCombo( (const QString &)currentDir); |
711 | } | 715 | } |
712 | 716 | ||
713 | bool OpieFtp::populateRemoteView( ) | 717 | bool OpieFtp::populateRemoteView( ) |
714 | { | 718 | { |
715 | // qDebug("populate remoteview"); | 719 | // qDebug("populate remoteview"); |
716 | QString sfile=QDir::homeDirPath(); | 720 | QString sfile=QDir::homeDirPath(); |
717 | if(sfile.right(1) != "/") | 721 | if(sfile.right(1) != "/") |
718 | sfile+="/._temp"; | 722 | sfile+="/._temp"; |
719 | else | 723 | else |
720 | sfile+="._temp"; | 724 | sfile+="._temp"; |
721 | QFile file( sfile); | 725 | QFile file( sfile); |
722 | Remote_View->clear(); | 726 | Remote_View->clear(); |
723 | QString s, File_Name; | 727 | QString s, File_Name; |
724 | QListViewItem *itemDir=NULL, *itemFile=NULL; | 728 | QListViewItem *itemDir=NULL, *itemFile=NULL; |
725 | QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] "); | 729 | QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] "); |
726 | QString fileL, fileS, fileDate; | 730 | QString fileL, fileS, fileDate; |
727 | if ( file.open(IO_ReadOnly)) { | 731 | if ( file.open(IO_ReadOnly)) { |
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h index 109b5f8..9d5d211 100644 --- a/noncore/net/opieftp/opieftp.h +++ b/noncore/net/opieftp/opieftp.h | |||
@@ -1,44 +1,45 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | opieftp.h | 2 | opieftp.h |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
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 | #ifndef OPIEFTP_H | 12 | #ifndef OPIEFTP_H |
13 | #define OPIEFTP_H | 13 | #define OPIEFTP_H |
14 | 14 | ||
15 | #include <qvariant.h> | 15 | #include <qvariant.h> |
16 | #include <qdialog.h> | 16 | #include <qdialog.h> |
17 | #include <qmainwindow.h> | 17 | #include <qmainwindow.h> |
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <qstring.h> | 19 | #include <qstring.h> |
20 | #include <qpoint.h> | 20 | #include <qpoint.h> |
21 | #include <qpixmap.h> | ||
21 | 22 | ||
22 | class QVBoxLayout; | 23 | class QVBoxLayout; |
23 | class QHBoxLayout; | 24 | class QHBoxLayout; |
24 | class QGridLayout; | 25 | class QGridLayout; |
25 | class QComboBox; | 26 | class QComboBox; |
26 | class QListView; | 27 | class QListView; |
27 | class QListViewItem; | 28 | class QListViewItem; |
28 | class QLabel; | 29 | class QLabel; |
29 | class QProgressBar; | 30 | class QProgressBar; |
30 | class QSpinBox; | 31 | class QSpinBox; |
31 | class QTabWidget; | 32 | class QTabWidget; |
32 | class QWidget; | 33 | class QWidget; |
33 | class QPEToolBar; | 34 | class QPEToolBar; |
34 | class QPEMenuBar; | 35 | class QPEMenuBar; |
35 | class QPopupMenu; | 36 | class QPopupMenu; |
36 | class QFile; | 37 | class QFile; |
37 | class QLineEdit; | 38 | class QLineEdit; |
38 | class QPushButton; | 39 | class QPushButton; |
39 | class QToolButton; | 40 | class QToolButton; |
40 | class QStringList; | 41 | class QStringList; |
41 | class QListBox; | 42 | class QListBox; |
42 | class QTimer; | 43 | class QTimer; |
43 | 44 | ||
44 | class OpieFtp : public QMainWindow | 45 | class OpieFtp : public QMainWindow |
@@ -106,35 +107,36 @@ protected slots: | |||
106 | 107 | ||
107 | void tabChanged(QWidget*); | 108 | void tabChanged(QWidget*); |
108 | void cleanUp(); | 109 | void cleanUp(); |
109 | 110 | ||
110 | void remoteRename(); | 111 | void remoteRename(); |
111 | void localRename(); | 112 | void localRename(); |
112 | 113 | ||
113 | void currentPathComboChanged(); | 114 | void currentPathComboChanged(); |
114 | void currentPathComboActivated(const QString &); | 115 | void currentPathComboActivated(const QString &); |
115 | void switchToLocalTab(); | 116 | void switchToLocalTab(); |
116 | void switchToRemoteTab(); | 117 | void switchToRemoteTab(); |
117 | void switchToConfigTab(); | 118 | void switchToConfigTab(); |
118 | 119 | ||
119 | void fillCombos(); | 120 | void fillCombos(); |
120 | void clearCombos(); | 121 | void clearCombos(); |
121 | void fillRemoteCombo(const QString&); | 122 | void fillRemoteCombo(const QString&); |
122 | void fillCombo(const QString &); | 123 | void fillCombo(const QString &); |
123 | void serverComboSelected(int); | 124 | void serverComboSelected(int); |
124 | void deleteServer(); | 125 | void deleteServer(); |
125 | void connectorBtnToggled(bool); | 126 | void connectorBtnToggled(bool); |
126 | void NewServer(); | 127 | void NewServer(); |
127 | void serverListClicked( const QString &); | 128 | void serverListClicked( const QString &); |
128 | 129 | ||
129 | protected: | 130 | protected: |
131 | QPixmap unknownXpm; | ||
130 | bool fuckeduphack; | 132 | bool fuckeduphack; |
131 | QStringList remoteDirPathStringList, localDirPathStringList; | 133 | QStringList remoteDirPathStringList, localDirPathStringList; |
132 | QString newServerName; | 134 | QString newServerName; |
133 | void nullifyCallBack(); | 135 | void nullifyCallBack(); |
134 | QGridLayout* tabLayout; | 136 | QGridLayout* tabLayout; |
135 | QGridLayout* tabLayout_2; | 137 | QGridLayout* tabLayout_2; |
136 | QGridLayout* tabLayout_3; | 138 | QGridLayout* tabLayout_3; |
137 | 139 | ||
138 | }; | 140 | }; |
139 | 141 | ||
140 | #endif // OPIEFTP_H | 142 | #endif // OPIEFTP_H |