summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 8d07f69..9721f84 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -276,49 +276,49 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in
void AdvancedFm::refreshCurrentTab() {
populateView();
// if ( TabWidget->currentWidget() == tab) {
}
void AdvancedFm::switchToLocalTab() {
TabWidget->setCurrentWidget(0);
// Local_View->setFocus();
whichTab = 1;
}
void AdvancedFm::switchToRemoteTab() {
TabWidget->setCurrentWidget(1);
// Remote_View->setFocus();
whichTab = 2;
}
void AdvancedFm::currentPathComboChanged() {
if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
CurrentDir()->setPath( currentPathCombo->lineEdit()->text() );
populateView();
} else {
- QMessageBox::message(tr("Note"),tr("That directory does not exist"));
+ QMessageBox::message(tr("Note"),tr("<p>That directory does not exist</p>"));
}
}
void AdvancedFm::fillCombo(const QString &currentPath) {
if ( TabWidget->currentWidget() == tab) {
// if ( whichTab == 1) {
currentPathCombo->lineEdit()->setText( currentPath);
if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) {
currentPathCombo->clear();
localDirPathStringList.prepend( currentPath );
currentPathCombo->insertStringList( localDirPathStringList,-1);
}
} else {
currentPathCombo->lineEdit()->setText( currentPath);
if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) {
currentPathCombo->clear();
remoteDirPathStringList.prepend( currentPath );
currentPathCombo->insertStringList( remoteDirPathStringList,-1);
}
}
}
void AdvancedFm::currentPathComboActivated(const QString & currentPath) {
@@ -648,49 +648,49 @@ void AdvancedFm::addCustomDir() {
}
if(addIt) {
menuButton->insertItem(dir);
// customDirMenu->insertItem(dir);
list << dir;
}
cfg.writeEntry("CustomDir", list, ',');
cfg.write();
}
void AdvancedFm::removeCustomDir() {
// odebug << "remove custom dir" << oendl;
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
QStringList list2;
dir = CurrentDir()->canonicalPath();
int ramble=2;
// int ramble=-24;
//first remove list
if(list.grep(dir,true).isEmpty()) {
QMessageBox::message(tr( "AdvancedFm" ),
- tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!"));
+ tr("<p>Cannot remove current directory from bookmarks. It is not bookmarked!</p>"));
} else {
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
if((*it) != dir) {
//current item is not our current dir, so add it to temp list
list2 <<(*it);
} else {
// customDirMenu->removeItem( ramble);
menuButton->remove( ramble);
}
ramble++;
// ramble--;
}
cfg.writeEntry("CustomDir", list2, ',');
cfg.write();
}
// customDirsToMenu();
}
void AdvancedFm::gotoCustomDir(const QString &dir) {
// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
// QString curDir = dir;
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index f14f588..706658e 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -126,95 +126,95 @@ void AdvancedFm::runText() {
QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
e << curFile;
}
}
void AdvancedFm::makeDir() {
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QDir *thisDir = CurrentDir();
QString filename = fileDlg->LineEdit1->text();
thisDir->mkdir( thisDir->canonicalPath()+"/"+filename);
}
populateView();
}
void AdvancedFm::doDelete() {
QStringList curFileList = getPath();
bool doMsg=true;
int count = curFileList.count();
if( count > 0) {
if(count > 1 ) {
QString msg;
- msg=tr("Really delete\n%1 files?").arg(count);
+ msg=tr("<p>Really delete %1 files?</p>").arg(count);
switch ( QMessageBox::warning(this,tr("Delete"),msg
,tr("Yes"),tr("No"),0,0,1) )
{
case 0:
doMsg=false;
break;
case 1:
return;
break;
};
}
QString myFile;
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
myFile = (*it);
if( myFile.find(" -> ",0,TRUE) != -1)
myFile = myFile.left( myFile.find(" -> ",0,TRUE));
QString f = CurrentDir()->canonicalPath();
if(f.right(1).find("/",0,TRUE) == -1)
f += "/";
f += myFile;
if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
//if file is a directory
switch ( QMessageBox::warning( this, tr("Delete Directory?"),
- tr("Really delete %1\nand all it's contents ?" ).arg( f ) ,
+ tr("<p>Really delete %1 and all it's contents?</p>" ).arg( f ) ,
tr("Yes"), tr("No"), 0, 0, 1) ) {
case 0:
{
f=f.left(f.length()-1);
QString cmd="rm -rf "+f;
startProcess( (const QString)cmd.latin1() );
populateView();
}
break;
case 1:
// exit
break;
};
} else {
if(doMsg) {
switch ( QMessageBox::warning(this,tr("Delete"),
- tr("Really delete\n%1?").arg( myFile ),
+ tr("<p>Really delete %1?</p>").arg( myFile ),
tr("Yes"), tr("No"), 0, 0, 1) ) {
case 1:
return;
break;
};
}
QString cmd="rm "+f;
QFile file(f);
QFileInfo fi(myFile);
if( fi.fileName().find("../",0,TRUE)==-1) {
// odebug << "remove link files "+myFile << oendl;
// DocLnk lnk(f);
DocLnk *lnk;
lnk = new DocLnk(f);
// odebug << "Deleting doclnk " + lnk->linkFile() << oendl;
if(lnk->isValid())
lnk->removeLinkFile();
// delete lnk;
file.remove();
}
}
}
@@ -265,49 +265,49 @@ void AdvancedFm::upDir() {
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
thisDir->cd( current, TRUE);
populateView();
update();
}
void AdvancedFm::copyTimer() {
QTimer::singleShot(125,this,SLOT(copy()));
}
void AdvancedFm::copy() {
QStringList curFileList = getPath();
QDir *thisDir = CurrentDir();
QDir *thatDir = OtherDir();
bool doMsg=true;
int count=curFileList.count();
if( count > 0) {
if(count > 1 ){
QString msg;
- msg=tr("Really copy\n%1 files?").arg(count);
+ msg=tr("<p>Really copy %1 files?</p>").arg(count);
switch ( QMessageBox::warning(this,tr("Copy"),msg
,tr("Yes"),tr("No"),0,0,1) )
{
case 0:
doMsg=false;
break;
case 1:
return;
break;
};
}
QString curFile, item, destFile;
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item=(*it);
if(item.find("->",0,TRUE)) //symlink
item = item.left(item.find("->",0,TRUE));
curFile = thisDir->canonicalPath()+"/"+ item;
destFile = thatDir->canonicalPath()+"/"+ item;
// odebug << "Destination file is "+destFile << oendl;
// odebug << "CurrentFile file is " + curFile << oendl;
@@ -480,61 +480,61 @@ void AdvancedFm::move() {
return;
break;
};
if( !copyFile( curFile, destFile) ) {
QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg(curFile));
return;
} else
QFile::remove(curFile);
}
}
}
rePopulate();
// setOtherTabCurrent();
}
bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
int err = 0;
if( copyDirectory( src, dest ) ) {
QString cmd = "rm -rf " + src;
err = system((const char*)cmd);
} else
err = -1;
if(err!=0) {
- QMessageBox::message(tr("Note"),tr("Could not move\n") + src);
+ QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg( src));
return false;
}
return true;
}
bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
QString cmd = "/bin/cp -fpR " + src + " " + dest;
owarn << cmd << oendl;
int err = system( (const char *) cmd );
if ( err != 0 ) {
- QMessageBox::message("AdvancedFm", tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) );
+ QMessageBox::message("AdvancedFm", tr( "<p>Could not copy %1 to %2</p>").arg( src ).arg( dest ) );
return false;
}
return true;
}
bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
if(QFileInfo(src).isDir()) {
if( copyDirectory( src, dest )) {
// setOtherTabCurrent();
rePopulate();
return true;
}
else
return false;
}
bool success = true;
struct stat status;
QFile srcFile(src);
QFile destFile(dest);
int err=0;