summaryrefslogtreecommitdiff
authordrw <drw>2005-04-02 00:04:50 (UTC)
committer drw <drw>2005-04-02 00:04:50 (UTC)
commitb92357d5566b9ee220ff5f4e8eb612b2db32e20b (patch) (side-by-side diff)
tree26f99f1ca215ac44862145c2ba94f9a0eec0e16f
parent8a1c307f9dfc26a31d42f29f29a5b1c048b99102 (diff)
downloadopie-b92357d5566b9ee220ff5f4e8eb612b2db32e20b.zip
opie-b92357d5566b9ee220ff5f4e8eb612b2db32e20b.tar.gz
opie-b92357d5566b9ee220ff5f4e8eb612b2db32e20b.tar.bz2
Set pixmaps for correct buttons - thanks Mickey for finding
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index 2746732..069b625 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -262,200 +262,200 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap,
}
OFileSelectorItem::~OFileSelectorItem()
{
}
bool OFileSelectorItem::isLocked()const
{
return m_locked;
}
QString OFileSelectorItem::directory()const
{
return m_dir;
}
bool OFileSelectorItem::isDir()const
{
return m_isDir;
}
QString OFileSelectorItem::path()const
{
return text( 1 );
}
QString OFileSelectorItem::key( int id, bool )const
{
QString ke;
/*
* id = 0 ||id == 1 : Sort By Name but Directories at Top
* id = 2 : Sort By Size: Prepend '0' to the key
*/
if( id == 0 || id == 1 )
{ // name
if( m_isDir )
{
ke.append("0" );
ke.append( text(1) );
}
else
{
ke.append("1" );
ke.append( text(1) );
}
return ke;
}else if(id == 2) {
return text(2).rightJustify(20, '0');
}else
return text( id );
}
OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel)
:QWidget( parent ), m_sel( sel )
{
m_all = false;
QVBoxLayout* lay = new QVBoxLayout( this );
m_currentDir = startDir;
/*
* now we add a special bar
* One Button For Up
* Home
* Doc
* And a dropdown menu with FileSystems
* FUTURE: one to change dir with lineedit
* Bookmarks
* Create Dir
*/
QHBox* box = new QHBox(this );
box->setBackgroundMode( PaletteButton );
box->setSpacing( 0 );
QPixmap pic;
QToolButton *btn = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
btn->setPixmap( pic );
connect(btn, SIGNAL(clicked() ),
this, SLOT( cdUP() ) );
btn = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
btn->setPixmap( pic );
connect(btn, SIGNAL(clicked() ),
this, SLOT( cdHome() ) );
btn = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
btn->setPixmap( pic );
connect(btn, SIGNAL(clicked() ),
this, SLOT(cdDoc() ) );
m_btnNew = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- btn->setPixmap( pic );
+ m_btnNew->setPixmap( pic );
connect(m_btnNew, SIGNAL(clicked() ),
this, SLOT(slotNew() ) );
m_btnClose = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- btn->setPixmap( pic );
+ m_btnClose->setPixmap( pic );
connect(m_btnClose, SIGNAL(clicked() ),
selector(), SIGNAL(closeMe() ) );
btn = new QToolButton( box );
pic.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
btn->setPixmap( pic );
m_fsButton = btn;
/* let's fill device parts */
QPopupMenu* pop = new QPopupMenu(this);
connect(pop, SIGNAL( activated(int) ),
this, SLOT(slotFSActivated(int) ) );
StorageInfo storage;
const QList<FileSystem> &fs = storage.fileSystems();
QListIterator<FileSystem> it(fs);
for ( ; it.current(); ++it )
{
const QString disk = (*it)->name();
const QString path = (*it)->path();
m_dev.insert( disk, path );
pop->insertItem( disk );
}
m_fsPop = pop;
connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed()));
lay->addWidget( box );
m_view = new QListView( this );
m_view->installEventFilter(this);
QPEApplication::setStylusOperation( m_view->viewport(),
QPEApplication::RightOnHold);
m_view->addColumn(" " );
m_view->addColumn(tr("Name"), 135 );
m_view->addColumn(tr("Size"), -1 );
m_view->addColumn(tr("Date"), 60 );
m_view->addColumn(tr("Mime Type"), -1 );
m_view->setSorting( 1 );
m_view->setAllColumnsShowFocus( TRUE );
lay->addWidget( m_view, 1000 );
connectSlots();
}
void OFileViewFileListView::slotFSpressed()
{
m_fsPop->exec(QPoint( QCursor::pos().x(), QCursor::pos().y()));
m_fsButton->setDown(false);
}
OFileViewFileListView::~OFileViewFileListView()
{
}
void OFileViewFileListView::slotNew()
{
DocLnk lnk;
emit selector()->newSelected( lnk );
}
OFileSelectorItem* OFileViewFileListView::currentItem()const
{
QListViewItem* item = m_view->currentItem();
if (!item )
return 0l;
return static_cast<OFileSelectorItem*>(item);
}
void OFileViewFileListView::reread( bool all )
{
m_view->clear();
if (selector()->showClose() )
m_btnClose->show();
else
m_btnClose->hide();
if (selector()->showNew() )
m_btnNew->show();
else
m_btnNew->hide();
m_mimes = selector()->currentMimeType();
m_all = all;
QDir dir( m_currentDir );
if (!dir.exists() )
return;
dir.setSorting( QDir::Name | QDir::DirsFirst | QDir::Reversed );