summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-18 01:11:48 (UTC)
committer llornkcor <llornkcor>2002-03-18 01:11:48 (UTC)
commit4c0bbc662731b8d3e61f43735fd6131746da306f (patch) (side-by-side diff)
treef6b1f12bd7e1a6e73a667189bd4600c10b1ec11e
parentb02657a01fc513e099c2d66be48d5a7b46cf6074 (diff)
downloadopie-4c0bbc662731b8d3e61f43735fd6131746da306f.zip
opie-4c0bbc662731b8d3e61f43735fd6131746da306f.tar.gz
opie-4c0bbc662731b8d3e61f43735fd6131746da306f.tar.bz2
added cinocs to file
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp30
-rw-r--r--core/apps/textedit/textedit.cpp15
2 files changed, 34 insertions, 11 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index 92c15cb..8cb7c38 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -64,25 +64,26 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
homeButton->setFlat(TRUE);
layout->addWidget( homeButton, 0, 2 );
FileStack = new QWidgetStack( this );
- ListView = new QListView( this, "ListView" );
+ ListView = new QListView( this, "ListView" );
ListView->setMinimumSize( QSize( 100, 25 ) );
ListView->addColumn( tr( "Name" ) );
- ListView->setColumnWidth(0,140);
+ ListView->setColumnWidth(0,120);
ListView->setSorting( 2, FALSE);
ListView->addColumn( tr( "Size" ) );
- ListView->setColumnWidth(1,59);
+ ListView->setColumnWidth(1,-1);
+ ListView->addColumn( "Date",-1);
// ListView->addColumn( tr( "" ) );
ListView->setColumnWidthMode(0,QListView::Manual);
ListView->setColumnAlignment(1,QListView::AlignRight);
-// ListView->setMultiSelection(true);
-// ListView->setSelectionMode(QListView::Extended);
+ ListView->setColumnAlignment(2,QListView::AlignRight);
ListView->setAllColumnsShowFocus( TRUE );
+
connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
FileStack->addWidget( ListView, get_unique_id() );
fileSelector = new FileSelector( "text/*", FileStack, "fileselector" , FALSE, FALSE); //buggy
// connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) );
// connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) );
@@ -115,44 +116,55 @@ void fileBrowser::setFileView( int selection )
selectionChanged( SelectionCombo->currentText() );
}
void fileBrowser::populateList()
{
ListView->clear();
+ bool isDir=FALSE;
//qDebug(currentDir.canonicalPath());
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
currentDir.setMatchAllDirs(TRUE);
currentDir.setNameFilter(filterStr);
// currentDir.setNameFilter("*.txt;*.etx");
- QString fileL, fileS;
+ QString fileL, fileS, fileDate;
const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ){
QString symLink=fi->readLink();
// qDebug("Symlink detected "+symLink);
QFileInfo sym( symLink);
fileS.sprintf( "%10li", sym.size() );
fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
-
+ fileDate = sym.lastModified().toString();
} else {
// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
fileS.sprintf( "%10li", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
+ fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
+ isDir=TRUE;
// qDebug( fileL);
}
}
- item= new QListViewItem( ListView,fileL,fileS );
+ if(fileL !="./") {
+ item= new QListViewItem( ListView,fileL,fileS , fileDate);
+ if(isDir || fileL.find("/",0,TRUE) != -1)
+ item->setPixmap( 0, Resource::loadPixmap( "folder" ));
+ else
+ item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
+ }
+ isDir=FALSE;
++it;
}
- ListView->setSorting( 2, FALSE);
+// ListView->setSorting( 2, FALSE);
+ ListView->setSorting( 3, FALSE);
dirLabel->setText(currentDir.canonicalPath());
}
void fileBrowser::upDir()
{
// qDebug(currentDir.canonicalPath());
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 68ee1b4..d3f5fb4 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -353,13 +353,12 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
searchEdit = new QLineEdit( searchBar, "searchEdit" );
searchBar->setStretchableWidget( searchEdit );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( search() ) );
-
a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
a->addTo( searchBar );
a->addTo( edit );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
@@ -416,13 +415,13 @@ TextEdit::~TextEdit()
cfg.setGroup("View");
QFont f = editor->font();
cfg.writeEntry("FontSize",f.pointSize());
cfg.writeEntry("Bold",f.bold());
cfg.writeEntry("Italic",f.italic());
cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth);
- cfg.writeEntry( "FileView", viewSelection );
+ cfg.writeEntry( "FileView", viewSelection );
}
void TextEdit::zoomIn()
{
setFontSize(editor->font().pointSize()+1,FALSE);
}
@@ -514,12 +513,16 @@ void TextEdit::fileOpen()
delete browseForFiles;
editor->setEdited( FALSE);
edited1=FALSE;
edited=FALSE;
if(caption().left(1)=="*")
setCaption(caption().right(caption().length()-1));
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ if(cfg.readEntry("SearchBar","Closed") != "Opened")
+ searchBar->hide();
}
#if 0
void TextEdit::slotFind()
{
FindDialog frmFind( "Text Editor", this );
@@ -568,24 +571,32 @@ void TextEdit::editPaste()
void TextEdit::editFind()
{
searchBar->show();
searchVisible = TRUE;
searchEdit->setFocus();
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ cfg.writeEntry("SearchBar","Opened");
+
}
void TextEdit::findNext()
{
editor->find( searchEdit->text(), FALSE, FALSE );
}
void TextEdit::findClose()
{
searchVisible = FALSE;
searchBar->hide();
+ Config cfg("TextEdit");
+ cfg.setGroup("View");
+ cfg.writeEntry("SearchBar","Closed");
+ cfg.write();
}
void TextEdit::search()
{
editor->find( searchEdit->text(), FALSE, FALSE );
}