-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 38 | ||||
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 2 |
2 files changed, 23 insertions, 17 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 23244a2..92804b2 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -74,53 +74,57 @@ AdvancedFm::AdvancedFm( ) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | AdvancedFm::~AdvancedFm() { | 76 | AdvancedFm::~AdvancedFm() { |
77 | } | 77 | } |
78 | 78 | ||
79 | void AdvancedFm::cleanUp() { | 79 | void AdvancedFm::cleanUp() { |
80 | QString sfile=QDir::homeDirPath(); | 80 | QString sfile=QDir::homeDirPath(); |
81 | if(sfile.right(1) != "/") | 81 | if(sfile.right(1) != "/") |
82 | sfile+="/._temp"; | 82 | sfile+="/._temp"; |
83 | else | 83 | else |
84 | sfile+="._temp"; | 84 | sfile+="._temp"; |
85 | QFile file( sfile); | 85 | QFile file( sfile); |
86 | if(file.exists()) | 86 | if(file.exists()) |
87 | file.remove(); | 87 | file.remove(); |
88 | } | 88 | } |
89 | 89 | ||
90 | void AdvancedFm::tabChanged(QWidget *) { | 90 | void AdvancedFm::tabChanged(QWidget *w) { |
91 | if (TabWidget->getCurrentTab() == 0) { | 91 | qDebug("tab changed %d",TabWidget->getCurrentTab()); |
92 | |||
93 | if ( w == tab) { | ||
94 | // if (TabWidget->getCurrentTab() == 0) { | ||
92 | // if (TabWidget->currentPageIndex() == 0) { | 95 | // if (TabWidget->currentPageIndex() == 0) { |
93 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 96 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
94 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 97 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
95 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 98 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
96 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); | 99 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); |
97 | setCaption("AdvancedFm :: "+fs+" :: " | 100 | setCaption("AdvancedFm :: "+fs+" :: " |
98 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); | 101 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); |
99 | 102 | ||
100 | } | 103 | } |
101 | if (TabWidget->getCurrentTab() == 1) { | 104 | if ( w == tab_2) { |
105 | // if (TabWidget->getCurrentTab() == 1) { | ||
102 | 106 | ||
103 | // if (TabWidget->currentPageIndex() == 1) { | 107 | // if (TabWidget->currentPageIndex() == 1) { |
104 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); | 108 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); |
105 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); | 109 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); |
106 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); | 110 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); |
107 | QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); | 111 | QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); |
108 | setCaption("AdvancedFm :: "+fs+" :: " | 112 | setCaption("AdvancedFm :: "+fs+" :: " |
109 | +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" ); | 113 | +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" ); |
110 | } | 114 | } |
111 | } | 115 | } |
112 | 116 | ||
113 | 117 | ||
114 | void AdvancedFm::populateLocalView() { | 118 | void AdvancedFm::populateLocalView() { |
115 | QPixmap pm; | 119 | QPixmap pm; |
116 | Local_View->clear(); | 120 | Local_View->clear(); |
117 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 121 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
118 | currentDir.setMatchAllDirs(TRUE); | 122 | currentDir.setMatchAllDirs(TRUE); |
119 | currentDir.setNameFilter(filterStr); | 123 | currentDir.setNameFilter(filterStr); |
120 | QString fileL, fileS, fileDate; | 124 | QString fileL, fileS, fileDate; |
121 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); | 125 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); |
122 | setCaption("AdvancedFm :: "+fs+" :: " | 126 | setCaption("AdvancedFm :: "+fs+" :: " |
123 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); | 127 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); |
124 | bool isDir=FALSE; | 128 | bool isDir=FALSE; |
125 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 129 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
126 | QFileInfoListIterator it(*list); | 130 | QFileInfoListIterator it(*list); |
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index 946d038..a60cea6 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp | |||
@@ -252,31 +252,33 @@ void Output::processFinished() { | |||
252 | // this, SLOT(commandStdin(const QByteArray &))); | 252 | // this, SLOT(commandStdin(const QByteArray &))); |
253 | } | 253 | } |
254 | 254 | ||
255 | //============================== | 255 | //============================== |
256 | 256 | ||
257 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 257 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
258 | : QDialog( parent, name, modal, fl ) | 258 | : QDialog( parent, name, modal, fl ) |
259 | { | 259 | { |
260 | if ( !name ) | 260 | if ( !name ) |
261 | setName( "InputDialog" ); | 261 | setName( "InputDialog" ); |
262 | resize( 234, 50 ); | 262 | resize( 234, 50 ); |
263 | setMaximumSize( QSize( 240, 50 ) ); | 263 | setMaximumSize( QSize( 240, 50 ) ); |
264 | setCaption( tr(name ) ); | 264 | setCaption( tr(name ) ); |
265 | 265 | ||
266 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 266 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
267 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | 267 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); |
268 | LineEdit1->setFocus(); | ||
269 | LineEdit1->setFocus(); | ||
268 | connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() )); | 270 | connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() )); |
269 | } | 271 | } |
270 | 272 | ||
271 | InputDialog::~InputDialog() { | 273 | InputDialog::~InputDialog() { |
272 | inputText = LineEdit1->text(); | 274 | inputText = LineEdit1->text(); |
273 | } | 275 | } |
274 | 276 | ||
275 | void InputDialog::setInputText(const QString &string) { | 277 | void InputDialog::setInputText(const QString &string) { |
276 | LineEdit1->setText( string); | 278 | LineEdit1->setText( string); |
277 | } | 279 | } |
278 | 280 | ||
279 | void InputDialog::returned() { | 281 | void InputDialog::returned() { |
280 | inputText = LineEdit1->text(); | 282 | inputText = LineEdit1->text(); |
281 | this->accept(); | 283 | this->accept(); |
282 | } | 284 | } |