-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 3 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 5 |
3 files changed, 18 insertions, 9 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index d56e746..bb7f346 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -65,28 +65,26 @@ | |||
65 | #include <string.h> | 65 | #include <string.h> |
66 | #include <errno.h> | 66 | #include <errno.h> |
67 | #include <sys/vfs.h> | 67 | #include <sys/vfs.h> |
68 | #include <mntent.h> | 68 | #include <mntent.h> |
69 | #include <sys/utsname.h> | 69 | #include <sys/utsname.h> |
70 | 70 | ||
71 | AdvancedFm::AdvancedFm( ) | 71 | AdvancedFm::AdvancedFm( ) |
72 | : QMainWindow( ) { | 72 | : QMainWindow( ) { |
73 | init(); | 73 | init(); |
74 | renameBox = 0; | 74 | renameBox = 0; |
75 | 75 | ||
76 | initConnections(); | 76 | initConnections(); |
77 | TabWidget->setCurrentTab(1); | 77 | whichTab=1; |
78 | populateView(); | 78 | rePopulate(); |
79 | TabWidget->setCurrentTab(0); | ||
80 | populateView(); | ||
81 | currentPathCombo->setFocus(); | 79 | currentPathCombo->setFocus(); |
82 | } | 80 | } |
83 | 81 | ||
84 | AdvancedFm::~AdvancedFm() { | 82 | AdvancedFm::~AdvancedFm() { |
85 | } | 83 | } |
86 | 84 | ||
87 | 85 | ||
88 | void AdvancedFm::cleanUp() | 86 | void AdvancedFm::cleanUp() |
89 | { | 87 | { |
90 | QString sfile=QDir::homeDirPath(); | 88 | QString sfile=QDir::homeDirPath(); |
91 | if(sfile.right(1) != "/") | 89 | if(sfile.right(1) != "/") |
92 | sfile+="/._temp"; | 90 | sfile+="/._temp"; |
@@ -108,25 +106,24 @@ void AdvancedFm::tabChanged(QWidget *w) | |||
108 | 106 | ||
109 | QString path = CurrentDir()->canonicalPath(); | 107 | QString path = CurrentDir()->canonicalPath(); |
110 | currentPathCombo->lineEdit()->setText( path ); | 108 | currentPathCombo->lineEdit()->setText( path ); |
111 | 109 | ||
112 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 110 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
113 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 111 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
114 | 112 | ||
115 | QString fs= getFileSystemType( (const QString &) path); | 113 | QString fs= getFileSystemType( (const QString &) path); |
116 | 114 | ||
117 | setCaption("AdvancedFm :: "+fs+" :: " | 115 | setCaption("AdvancedFm :: "+fs+" :: " |
118 | +checkDiskSpace( (const QString &) path )+ " kB free" ); | 116 | +checkDiskSpace( (const QString &) path )+ " kB free" ); |
119 | chdir( path.latin1()); | 117 | chdir( path.latin1()); |
120 | //2populateView(); | ||
121 | } | 118 | } |
122 | 119 | ||
123 | 120 | ||
124 | void AdvancedFm::populateView() | 121 | void AdvancedFm::populateView() |
125 | { | 122 | { |
126 | QPixmap pm; | 123 | QPixmap pm; |
127 | QListView *thisView = CurrentView(); | 124 | QListView *thisView = CurrentView(); |
128 | QDir *thisDir = CurrentDir(); | 125 | QDir *thisDir = CurrentDir(); |
129 | QString path = thisDir->canonicalPath(); | 126 | QString path = thisDir->canonicalPath(); |
130 | 127 | ||
131 | thisView->clear(); | 128 | thisView->clear(); |
132 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 129 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
@@ -234,24 +231,36 @@ void AdvancedFm::populateView() | |||
234 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 231 | pm = Resource::loadPixmap( "UnknownDocument-14" ); |
235 | item->setPixmap( 0,pm); | 232 | item->setPixmap( 0,pm); |
236 | } | 233 | } |
237 | } | 234 | } |
238 | 235 | ||
239 | closedir(dir); | 236 | closedir(dir); |
240 | } | 237 | } |
241 | 238 | ||
242 | thisView->setSorting( 3,FALSE); | 239 | thisView->setSorting( 3,FALSE); |
243 | fillCombo( (const QString &) path ); | 240 | fillCombo( (const QString &) path ); |
244 | } | 241 | } |
245 | 242 | ||
243 | void AdvancedFm::rePopulate() | ||
244 | { | ||
245 | int tmpTab = whichTab; | ||
246 | qDebug("%d", tmpTab); | ||
247 | |||
248 | for(int i =1; i < 3; i++) | ||
249 | { | ||
250 | TabWidget->setCurrentTab(i - 1); | ||
251 | populateView(); | ||
252 | } | ||
253 | TabWidget->setCurrentTab( tmpTab - 1); | ||
254 | } | ||
246 | 255 | ||
247 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) | 256 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) |
248 | { | 257 | { |
249 | if(selectedItem) | 258 | if(selectedItem) |
250 | { | 259 | { |
251 | QString strItem=selectedItem->text(0); | 260 | QString strItem=selectedItem->text(0); |
252 | QString strSize=selectedItem->text(1); | 261 | QString strSize=selectedItem->text(1); |
253 | strSize=strSize.stripWhiteSpace(); | 262 | strSize=strSize.stripWhiteSpace(); |
254 | bool isDirectory = false; | 263 | bool isDirectory = false; |
255 | QString strItem2; | 264 | QString strItem2; |
256 | 265 | ||
257 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 )//if symlink | 266 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 )//if symlink |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 024ab29..3250a66 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -55,24 +55,25 @@ class AdvancedFm : public QMainWindow | |||
55 | Q_OBJECT | 55 | Q_OBJECT |
56 | public: | 56 | public: |
57 | AdvancedFm(); | 57 | AdvancedFm(); |
58 | ~AdvancedFm(); | 58 | ~AdvancedFm(); |
59 | protected slots: | 59 | protected slots: |
60 | void selectAll(); | 60 | void selectAll(); |
61 | void addToDocs(); | 61 | void addToDocs(); |
62 | void doDirChange(); | 62 | void doDirChange(); |
63 | void mkDir(); | 63 | void mkDir(); |
64 | void del(); | 64 | void del(); |
65 | void rn(); | 65 | void rn(); |
66 | void populateView(); | 66 | void populateView(); |
67 | void rePopulate(); | ||
67 | void showHidden(); | 68 | void showHidden(); |
68 | void showMenuHidden(); | 69 | void showMenuHidden(); |
69 | void writeConfig(); | 70 | void writeConfig(); |
70 | void readConfig(); | 71 | void readConfig(); |
71 | void ListClicked(QListViewItem *); | 72 | void ListClicked(QListViewItem *); |
72 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 73 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
73 | void makeDir(); | 74 | void makeDir(); |
74 | void doDelete(); | 75 | void doDelete(); |
75 | void tabChanged(QWidget*); | 76 | void tabChanged(QWidget*); |
76 | void cleanUp(); | 77 | void cleanUp(); |
77 | void renameIt(); | 78 | void renameIt(); |
78 | void runThis(); | 79 | void runThis(); |
@@ -111,25 +112,25 @@ protected: | |||
111 | QLineEdit *renameBox; | 112 | QLineEdit *renameBox; |
112 | 113 | ||
113 | void init(); | 114 | void init(); |
114 | void initConnections(); | 115 | void initConnections(); |
115 | void keyReleaseEvent( QKeyEvent *); | 116 | void keyReleaseEvent( QKeyEvent *); |
116 | void keyPressEvent( QKeyEvent *); | 117 | void keyPressEvent( QKeyEvent *); |
117 | QString getFileSystemType(const QString &); | 118 | QString getFileSystemType(const QString &); |
118 | QString getDiskSpace(const QString &); | 119 | QString getDiskSpace(const QString &); |
119 | void parsetab(const QString &fileName); | 120 | void parsetab(const QString &fileName); |
120 | QString checkDiskSpace(const QString &); | 121 | QString checkDiskSpace(const QString &); |
121 | QString dealWithSymName(const QString &); | 122 | QString dealWithSymName(const QString &); |
122 | QDir *CurrentDir(); | 123 | QDir *CurrentDir(); |
123 | QDir *OtherDir(); | 124 | QDir *OtherDir(); |
124 | QListView *CurrentView(); | 125 | QListView *CurrentView(); |
125 | QListView *OtherView(); | 126 | QListView *OtherView(); |
126 | void setOtherTabCurrent(); | 127 | void setOtherTabCurrent(); |
127 | 128 | ||
128 | protected slots: | 129 | protected slots: |
129 | void dirMenuSelected(int); | 130 | void dirMenuSelected(int); |
130 | void showFileMenu(); | 131 | void showFileMenu(); |
131 | void cancelMenuTimer(); | 132 | void cancelMenuTimer(); |
132 | void homeButtonPushed(); | 133 | void homeButtonPushed(); |
133 | void docButtonPushed(); | 134 | void docButtonPushed(); |
134 | void SDButtonPushed(); | 135 | void SDButtonPushed(); |
135 | void CFButtonPushed(); | 136 | void CFButtonPushed(); |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index f46503c..a82d69a 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -59,48 +59,47 @@ void AdvancedFm::showMenuHidden() | |||
59 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 59 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
60 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 60 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
61 | // b=FALSE; | 61 | // b=FALSE; |
62 | 62 | ||
63 | } | 63 | } |
64 | else | 64 | else |
65 | { | 65 | { |
66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
67 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 67 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
69 | // b=TRUE; | 69 | // b=TRUE; |
70 | } | 70 | } |
71 | populateView(); | 71 | rePopulate(); |
72 | // populateRemoteView(); | ||
73 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); | 72 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); |
74 | if(b) b = false; else b = true; | 73 | if(b) b = false; else b = true; |
75 | } | 74 | } |
76 | 75 | ||
77 | void AdvancedFm::showHidden() | 76 | void AdvancedFm::showHidden() |
78 | { | 77 | { |
79 | if (b) | 78 | if (b) |
80 | { | 79 | { |
81 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 80 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
82 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 81 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
83 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 82 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
84 | // b=FALSE; | 83 | // b=FALSE; |
85 | 84 | ||
86 | } | 85 | } |
87 | else | 86 | else |
88 | { | 87 | { |
89 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 88 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
90 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 89 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
91 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 90 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
92 | // b=TRUE; | 91 | // b=TRUE; |
93 | } | 92 | } |
94 | populateView(); | 93 | rePopulate(); |
95 | } | 94 | } |
96 | 95 | ||
97 | QString AdvancedFm::dealWithSymName(const QString &fileName) | 96 | QString AdvancedFm::dealWithSymName(const QString &fileName) |
98 | { | 97 | { |
99 | QString strItem = fileName; | 98 | QString strItem = fileName; |
100 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 99 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
101 | } | 100 | } |
102 | 101 | ||
103 | void AdvancedFm::runThis() | 102 | void AdvancedFm::runThis() |
104 | { | 103 | { |
105 | QString fs; | 104 | QString fs; |
106 | QDir *thisDir = CurrentDir(); | 105 | QDir *thisDir = CurrentDir(); |