extragear/utils/krusader
2010 March 11 04:03 UTC
SVN commit 1101845 by janlepper:
CHANGED: when open/refresh of a dir fails, don't annoy the user with a message box, but display the error in the status bar
M +2 -0 ChangeLog
M +20 -1 krusader/Panel/listpanel.cpp
M +2 -0 krusader/Panel/listpanel.h
M +6 -0 krusader/Panel/panelfunc.cpp
M +7 -2 krusader/VFS/ftp_vfs.cpp
M +9 -3 krusader/VFS/normal_vfs.cpp
M +1 -0 krusader/VFS/vfs.h
--- trunk/extragear/utils/krusader/ChangeLog #1101844:1101845
@@ -15,6 +15,8 @@
ADDED: buttons "(un)mount" and "eject" in mountman gui
ADDED: KMountMan::removable(), KMountMan::networkFilesystem()
+ CHANGED: when open/refresh of a dir fails, don't annoy the user with a message box,
+ but display the error in the status bar
CHANGED: icon size, icons/previews on/off are set seperately per view type
CHANGED: dim icons in unfocused panel (if dim colors is activated)
CHANGED: mountman gui: retrieve icons from Solid
--- trunk/extragear/utils/krusader/krusader/Panel/listpanel.cpp #1101844:1101845
@@ -112,7 +112,7 @@
ListPanel::ListPanel(int typeIn, QWidget *parent, bool &left) :
QWidget(parent), panelType(typeIn), colorMask(255), compareMode(false), statsAgent(0),
quickSearch(0), cdRootButton(0), cdUpButton(0), popupBtn(0), popup(0), inlineRefreshJob(0), _left(left),
- _locked(false), previewJob(0)
+ _locked(false), previewJob(0), vfsError(0)
{
gui = this;
@@ -1192,4 +1192,23 @@
_jumpBackURL = url;
}
+void ListPanel::slotVfsError(QString msg)
+{
+ status->hide();
+
+ if(!vfsError) {
+ vfsError = new QLabel(this);
+ vfsError->setWordWrap(true);
+ QPalette p(vfsError->palette());
+ p.setColor(QPalette::Window, QColor(240,150,150));
+ p.setColor(QPalette::WindowText, Qt::black);
+ vfsError->setPalette(p);
+ vfsError->setAutoFillBackground(true);
+ layout->addWidget(vfsError, 1, 1, 1, 1);
+ }
+ vfsError->setText(i18n("Error: %1", msg));
+ vfsError->show();
+}
+
+
#include "listpanel.moc"
--- trunk/extragear/utils/krusader/krusader/Panel/listpanel.h #1101844:1101845
@@ -178,6 +178,7 @@
void inlineRefreshInfoMessage(KJob* job, const QString &msg);
void inlineRefreshListResult(KJob* job);
void inlineRefreshPercent(KJob*, unsigned long);
+ void slotVfsError(QString msg);
signals:
@@ -215,6 +216,7 @@
KIO::Job *inlineRefreshJob;
QSplitter *splt;
KJob *previewJob;
+ QLabel *vfsError;
protected:
--- trunk/extragear/utils/krusader/krusader/Panel/panelfunc.cpp #1101844:1101845
@@ -166,6 +166,10 @@
}
}
+ if(panel->vfsError)
+ panel->vfsError->hide();
+ panel->status->show();
+
vfs* v = 0;
if (urlStack.count() == 0 || !urlStack.last().equals(url))
urlStack.push_back(url);
@@ -198,6 +202,8 @@
}
connect(files(), SIGNAL(startJob(KIO::Job*)),
panel, SLOT(slotJobStarted(KIO::Job*)));
+ connect(files(), SIGNAL(error(QString)),
+ panel, SLOT(slotVfsError(QString)));
if (vfsP->vfs_refresh(u)) {
break; // we have a valid refreshed URL now
}
--- trunk/extragear/utils/krusader/krusader/VFS/ftp_vfs.cpp #1101844:1101845
@@ -153,7 +153,9 @@
// we failed to refresh
listError = true;
// display error message
- if (!quietMode) job->uiDelegate()->showErrorMessage();
+ if (!quietMode)
+// job->uiDelegate()->showErrorMessage();
+ emit error(job->errorString());
}
busy = false;
}
@@ -171,7 +173,10 @@
}
if (!errorMsg.isEmpty()) {
- if (!quietMode) KMessageBox::sorry(krMainWindow, errorMsg);
+ printf("error\n");
+ if (!quietMode)
+// KMessageBox::sorry(krMainWindow, errorMsg);
+ emit error(errorMsg);
return false;
}
--- trunk/extragear/utils/krusader/krusader/VFS/normal_vfs.cpp #1101844:1101845
@@ -96,7 +96,9 @@
// check that the new origin exists
if (!QDir(path).exists()) {
- if (!quietMode) KMessageBox::error(krMainWindow, i18n("Directory %1 does not exist!", path), i18n("Error"));
+ if (!quietMode)
+// KMessageBox::error(krMainWindow, i18n("Directory %1 does not exist!", path), i18n("Error"));
+ emit error(i18n("Directory %1 does not exist!", path));
return false;
}
@@ -105,14 +107,18 @@
DIR* dir = opendir(path.toLocal8Bit());
if (!dir) {
- if (!quietMode) KMessageBox::error(krMainWindow, i18n("Can't open the %1 directory!", path), i18n("Error"));
+ if (!quietMode)
+// KMessageBox::error(krMainWindow, i18n("Can't open the %1 directory!", path), i18n("Error"));
+ emit error(i18n("Can't open the %1 directory!", path));
return false;
}
// change directory to the new directory
QString save = QDir::currentPath();
if (! QDir::setCurrent(path)) {
- if (!quietMode) KMessageBox::error(krMainWindow, i18n("Access denied to") + path, i18n("Error"));
+ if (!quietMode)
+// KMessageBox::error(krMainWindow, i18n("Access denied to") + path, i18n("Error"));
+ emit error(i18n("Access denied to %1", path));
closedir(dir);
return false;
}
--- trunk/extragear/utils/krusader/krusader/VFS/vfs.h #1101844:1101845
@@ -160,6 +160,7 @@
void updatedVfile(vfile* vf);
void cleared();
void deleteAllowed();
+ void error(QString msg);
protected:
/// Feel the vfs dictionary with vfiles, must be implemented for each vfs