author | harlekin <harlekin> | 2002-04-12 00:10:00 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-12 00:10:00 (UTC) |
commit | 26efd0a7135834626b4e6f275e57e85a97abd34f (patch) (side-by-side diff) | |
tree | b803f31e222d68f6acdfef9a10e6ccae683d4cb9 | |
parent | a1615d98bdd7430e0533c0325dfdc39bf6627ab2 (diff) | |
download | opie-26efd0a7135834626b4e6f275e57e85a97abd34f.zip opie-26efd0a7135834626b4e6f275e57e85a97abd34f.tar.gz opie-26efd0a7135834626b4e6f275e57e85a97abd34f.tar.bz2 |
take parent size
-rw-r--r-- | libopie/ofileselector.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index bc7c6c2..c3a3514 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc @@ -1,177 +1,179 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> .>+-= _;:, .> :=|. This library is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This library is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qnamespace.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qhbox.h> #include <qvbox.h> #include <qlayout.h> #include <qwidgetstack.h> #include <qlineedit.h> #include <qcheckbox.h> #include <qlabel.h> #include <qheader.h> #include <qdir.h> #include <qpainter.h> #include <qaction.h> #include <qpopupmenu.h> #include <qcursor.h> #include <qpe/qpeapplication.h> #include <qpe/fileselector.h> #include <qpe/applnk.h> #include <qpe/global.h> #include <qpe/mimetype.h> #include <qpe/resource.h> #include <qpe/storage.h> #include <unistd.h> #include <stdlib.h> #include <sys/stat.h> #include "ofileselector.h" QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; namespace { int indexByString( const QComboBox *box, const QString &str ){ int index= -1; for(int i= 0; i < box->count(); i++ ){ qWarning("str T%sT boxT%sT", str.latin1(), box->text(i).latin1() ); if( str == box->text(i ) ){ index= i; break; } } return index; } }; OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) { + + resize(wid->width(),wid->height()); m_selector = selector; m_currentDir = dirName; m_name = fileName; m_mimetypes = mimetypes; if( mimetypes.isEmpty() ) m_autoMime = true; m_mode = mode; m_shTool = true; m_shPerm = true; m_shLne = true; m_shChooser = true; m_shYesNo = true; // for FILESELECTOR only view is interesting m_location = 0; m_homeButton = 0; m_docButton = 0; m_hideButton = 0; m_ok = 0; m_cancel = 0; m_reread = 0; m_up = 0; m_View = 0; m_select = 0; m_stack = 0; m_select = 0; m_stack = 0; m_lay = 0; m_boxToolbar = 0; m_boxOk = 0; m_edit = 0; m_fnLabel = 0; m_checkPerm = 0; m_mimeCheck = 0; m_viewCheck = 0; m_pseudo = 0; m_pseudoLayout = 0; m_dir = true; m_files = true; m_custom = 0; m_showPopup = true; if(m_pixmaps == 0 ) // init the pixmaps initPics(); m_lay = new QVBoxLayout(this); init(); m_edit->setText( fileName ); } void OFileSelector::initPics() { qWarning("init pics" ); m_pixmaps = new QMap<QString,QPixmap>; QPixmap pm = Resource::loadPixmap( "folder" ); QPixmap lnk = Resource::loadPixmap( "symlink" ); QPainter painter( &pm ); painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); pm.setMask( pm.createHeuristicMask( FALSE ) ); m_pixmaps->insert("dirsymlink", pm ); QPixmap pm2 = Resource::loadPixmap( "lockedfolder" ); QPainter pen(&pm2 ); pen.drawPixmap(pm2.width()-lnk.width(), pm2.height()-lnk.height(), lnk ); pm2.setMask( pm2.createHeuristicMask( FALSE ) ); m_pixmaps->insert("symlinkedlocked", pm2 ); }; // let's initialize the gui /** -------------------- | cmbBox Button | -------------------- | FileSlector | | or | | OSelector | | | | | ____________________ | LineEdit | ____________________ | Permission Bar | ____________________ | ViewChoose | ____________________ | Save Cancel| ____________________ */ void OFileSelector::delItems() { QLayoutIterator it = m_lay->iterator(); while ( it.current() != 0 ){ it.deleteCurrent(); |