summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-04-15 01:46:54 (UTC)
committer llornkcor <llornkcor>2003-04-15 01:46:54 (UTC)
commitd2f7c238e852eb60fdcfe3e4024823480713e50e (patch) (unidiff)
tree0109f1fc75cd7477581cb2cfac1a349fcb44c6ef
parent79e83da7936995f247f7ad7ad0f768b6e2545cf1 (diff)
downloadopie-d2f7c238e852eb60fdcfe3e4024823480713e50e.zip
opie-d2f7c238e852eb60fdcfe3e4024823480713e50e.tar.gz
opie-d2f7c238e852eb60fdcfe3e4024823480713e50e.tar.bz2
fixed for bug 855, changed currentChanged(...) to clicked(...). also changed UnknownDocument-14 to scaled UnknownDocument
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofileselector.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 7481360..6748bec 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -1,14 +1,15 @@
1 1
2 2
3#include <qwmatrix.h>
3#include <qcheckbox.h> 4#include <qcheckbox.h>
4#include <qcombobox.h> 5#include <qcombobox.h>
5#include <qheader.h> 6#include <qheader.h>
6#include <qlabel.h> 7#include <qlabel.h>
7#include <qabstractlayout.h> 8#include <qabstractlayout.h>
8#include <qlayout.h> 9#include <qlayout.h>
9#include <qlineedit.h> 10#include <qlineedit.h>
10#include <qlistview.h> 11#include <qlistview.h>
11#include <qmessagebox.h> 12#include <qmessagebox.h>
12#include <qpainter.h> 13#include <qpainter.h>
13#include <qpushbutton.h> 14#include <qpushbutton.h>
14#include <qwidgetstack.h> 15#include <qwidgetstack.h>
@@ -125,25 +126,24 @@ OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent,
125 } 126 }
126 initVars(); 127 initVars();
127 m_currentDir = QPEApplication::documentDir(); 128 m_currentDir = QPEApplication::documentDir();
128 m_mode = FILESELECTOR; 129 m_mode = FILESELECTOR;
129 m_selector = NORMAL; 130 m_selector = NORMAL;
130 m_shClose = closeVisible; 131 m_shClose = closeVisible;
131 m_shNew = newVisible; 132 m_shNew = newVisible;
132 m_shLne = false; 133 m_shLne = false;
133 m_shPerm = false; 134 m_shPerm = false;
134 m_shYesNo = false; 135 m_shYesNo = false;
135 init(); 136 init();
136 137
137
138} 138}
139 139
140OFileSelector::~OFileSelector() 140OFileSelector::~OFileSelector()
141{ 141{
142 142
143 143
144} 144}
145 145
146void OFileSelector::setNewVisible( bool visible ) 146void OFileSelector::setNewVisible( bool visible )
147{ 147{
148 m_shNew = visible; 148 m_shNew = visible;
149 if( m_selector == NORMAL ){ 149 if( m_selector == NORMAL ){
@@ -687,26 +687,32 @@ void OFileSelector::addFile(const QString &/*mime*/, QFileInfo *info, bool symli
687 if(!m_files) 687 if(!m_files)
688 return; 688 return;
689 // if( !compliesMime(info->absFilePath(), mime ) ) 689 // if( !compliesMime(info->absFilePath(), mime ) )
690 // return; 690 // return;
691 MimeType type( info->absFilePath() ); 691 MimeType type( info->absFilePath() );
692 if (!compliesMime( type.id() ) ) 692 if (!compliesMime( type.id() ) )
693 return; 693 return;
694 694
695 QPixmap pix = type.pixmap(); 695 QPixmap pix = type.pixmap();
696 QString dir; 696 QString dir;
697 QString name; 697 QString name;
698 bool locked; 698 bool locked;
699 if( pix.isNull() ) 699 if( pix.isNull() ) {
700 pix = Resource::loadPixmap( "UnknownDocument-14"); 700 //TODO make this scaled pixmap global, so we dont have to keep doing this
701 QWMatrix matrix;
702 QPixmap pixer(Resource::loadPixmap( "UnknownDocument" ));
703 matrix.scale( .4, .4);
704 pix = pixer.xForm(matrix);
705// pix = Resource::loadPixmap( "UnknownDocument-14");
706 }
701 dir = info->dirPath( true ); 707 dir = info->dirPath( true );
702 if( symlink ) 708 if( symlink )
703 name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); 709 name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink();
704 else { 710 else {
705 name = info->fileName(); 711 name = info->fileName();
706 if( ( m_mode == OPEN && !info->isReadable() )|| 712 if( ( m_mode == OPEN && !info->isReadable() )||
707 ( m_mode == SAVE && !info->isWritable() ) ){ 713 ( m_mode == SAVE && !info->isWritable() ) ){
708 714
709 locked = true; pix = Resource::loadPixmap("locked"); 715 locked = true; pix = Resource::loadPixmap("locked");
710 } 716 }
711 } 717 }
712 new OFileSelectorItem( m_View, pix, name, 718 new OFileSelectorItem( m_View, pix, name,
@@ -913,25 +919,26 @@ void OFileSelector::initializeListView()
913 m_View->addColumn(tr("Name"), 135 ); 919 m_View->addColumn(tr("Name"), 135 );
914 m_View->addColumn(tr("Size"), -1 ); 920 m_View->addColumn(tr("Size"), -1 );
915 m_View->addColumn(tr("Date"), 60 ); 921 m_View->addColumn(tr("Date"), 60 );
916 m_View->addColumn(tr("Mime Type"), -1 ); 922 m_View->addColumn(tr("Mime Type"), -1 );
917 QHeader *header = m_View->header(); 923 QHeader *header = m_View->header();
918 header->hide(); 924 header->hide();
919 m_View->setSorting( 1 ); 925 m_View->setSorting( 1 );
920 m_View->setAllColumnsShowFocus( TRUE ); 926 m_View->setAllColumnsShowFocus( TRUE );
921 927
922 connect(m_View, SIGNAL(selectionChanged() ), 928 connect(m_View, SIGNAL(selectionChanged() ),
923 this, SLOT(slotSelectionChanged() ) ); 929 this, SLOT(slotSelectionChanged() ) );
924 930
925 connect(m_View, SIGNAL(currentChanged(QListViewItem *) ), 931 connect(m_View, SIGNAL(clicked(QListViewItem *) ),
932// connect(m_View, SIGNAL(currentChanged(QListViewItem *) ),
926 this, SLOT(slotCurrentChanged(QListViewItem * ) ) ); 933 this, SLOT(slotCurrentChanged(QListViewItem * ) ) );
927 934
928 connect(m_View, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint &, int) ), 935 connect(m_View, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint &, int) ),
929 this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) ); 936 this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) );
930 937
931 connect(m_View, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )), 938 connect(m_View, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )),
932 this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) ); 939 this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) );
933 940
934 m_pseudoLayout->addWidget( m_View, 288 ); 941 m_pseudoLayout->addWidget( m_View, 288 );
935 m_stack->addWidget( m_pseudo, EXTENDED ); 942 m_stack->addWidget( m_pseudo, EXTENDED );
936 } 943 }
937} 944}