summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-05-02 21:05:17 (UTC)
committer cniehaus <cniehaus>2003-05-02 21:05:17 (UTC)
commiteb2cf58480b21ab24166a1fda83f24cf61e010d0 (patch) (side-by-side diff)
treec0cd7c442a11bea0a6ceb5fdba7670351870269b
parent3eb477c27f32b8fa7900ddd5efceeacf6df87d25 (diff)
downloadopie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.zip
opie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.tar.gz
opie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.tar.bz2
tr()-fix -- don't use 2 !. One is enough
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 66353bb..d4351b0 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -586,294 +586,294 @@ void AdvancedFm::showFileMenu()
QPopupMenu *m = new QPopupMenu(0);
QPopupMenu *n = new QPopupMenu(0);
// QPopupMenu *o = new QPopupMenu(0);
m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
if ( QFileInfo(fi).isDir() )
{
m->insertSeparator();
m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() ));
}
else
{
if ( app )
m->insertItem( app->pixmap(), tr( "Open in "
+ app->name() ), this, SLOT( runThis() ) );
else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this
m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) );
m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) );
}
m->insertItem(tr("Actions"),n);
n->insertItem( tr( "Make Directory" ), this, SLOT( makeDir() ));
n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
n->insertSeparator();
n->insertItem( tr( "Rename" ), this, SLOT( renameIt() ));
n->insertItem( tr( "Copy" ), this, SLOT( copy() ));
n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() ));
n->insertItem( tr( "Move" ), this, SLOT( move() ));
n->insertSeparator();
n->insertItem( tr( "Delete" ), this, SLOT( doDelete() ));
m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
m->insertSeparator();
m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
#if defined(QT_QWS_OPIE)
m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
#endif
m->setCheckable(TRUE);
if (!b)
m->setItemChecked(m->idAt(0),TRUE);
else
m->setItemChecked(m->idAt(0),FALSE);
if(Ir::supported())
m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
m->setFocus();
m->exec( QPoint( 4,QCursor::pos().y()) );
if(m) delete m;
}
void AdvancedFm::cancelMenuTimer()
{
// qDebug("selectionChanged: cancel menu timer");
if( menuTimer.isActive() )
menuTimer.stop();
}
QString AdvancedFm::checkDiskSpace(const QString &path)
{
struct statfs fss;
if ( !statfs( path.latin1(), &fss ) )
{
int blkSize = fss.f_bsize;
// int totalBlks = fs.f_blocks;
int availBlks = fss.f_bavail;
long mult = blkSize / 1024;
long div = 1024 / blkSize;
if ( !mult ) mult = 1;
if ( !div ) div = 1;
return QString::number(availBlks * mult / div);
}
return "";
}
void AdvancedFm::addToDocs()
{
QStringList strListPaths = getPath();
QDir *thisDir = CurrentDir();
if( strListPaths.count() > 0)
{
QString curFile;
for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it )
{
curFile = thisDir->canonicalPath()+"/"+(*it);
// qDebug(curFile);
DocLnk f;
// curFile.replace(QRegExp("\\..*"),"");
f.setName((*it));
f.setFile( curFile);
f.writeLink();
}
}
}
void AdvancedFm::customDirsToMenu()
{
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QStringList list = cfg.readListEntry( "CustomDir", ',');
menuButton->insertItems(list );
// for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
// {
// customDirMenu->insertItem(*it );
// }
}
void AdvancedFm::dirMenuSelected(int item)
{
qDebug("menu item %d", item);
switch(item)
{
case -21:
case 0:
addCustomDir();
break;
case -22:
case 1:
removeCustomDir();
break;
default:
{
// gotoCustomDir( menuButton->text(item));
// gotoCustomDir( customDirMenu->text(item));
}
break;
};
}
void AdvancedFm::addCustomDir()
{
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
dir = CurrentDir()->canonicalPath();
bool addIt=true;
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
if( dir == (*it))
{
addIt=false;
}
}
if(addIt)
{
menuButton->insertItem(dir);
// customDirMenu->insertItem(dir);
list << dir;
}
cfg.writeEntry("CustomDir", list, ',');
cfg.write();
}
void AdvancedFm::removeCustomDir()
{
// qDebug("remove custom dir");
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("AdvancedFm",
- tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!!"));
+ QMessageBox::message(tr( "AdvancedFm" ),
+ tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!"));
}
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)
{
// qDebug("gotoCustomDir(const QString &dir) " +dir );
QString curDir = dir;
QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
// }
if( curDir == s_addBookmark)
{
addCustomDir();
}
if( curDir == s_removeBookmark)
{
removeCustomDir( );
}
else
{
if(QDir( curDir).exists() )
{
thisDir->setPath( curDir );
chdir( curDir.latin1() );
thisDir->cd( curDir, TRUE);
populateView();
}
}
}
QDir *AdvancedFm::CurrentDir()
{
if ( whichTab == 1)
{
return &currentDir;
}
else
{
return &currentRemoteDir;
}
}
QDir *AdvancedFm::OtherDir()
{
if ( whichTab == 1)
{
return &currentRemoteDir;
}
else
{
return &currentDir;
}
}
QListView * AdvancedFm::CurrentView()
{
if ( whichTab == 1)
return Local_View;
else
return Remote_View;
}
QListView * AdvancedFm::OtherView()
{
if ( whichTab == 1)
return Remote_View;
else
return Local_View;
}
void AdvancedFm::setOtherTabCurrent()
{
if ( whichTab == 1)
TabWidget->setCurrentTab(1);
else
TabWidget->setCurrentTab(0);
}