Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 15cadd4..c4d5033 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -34,50 +34,53 @@ | |||
34 | #include "ofileselector_p.h" | 34 | #include "ofileselector_p.h" |
35 | 35 | ||
36 | /* OPIE */ | 36 | /* OPIE */ |
37 | #include <opie2/ofileselector.h> | 37 | #include <opie2/ofileselector.h> |
38 | 38 | ||
39 | #include <qpe/qpeapplication.h> | 39 | #include <qpe/qpeapplication.h> |
40 | #include <qpe/mimetype.h> | 40 | #include <qpe/mimetype.h> |
41 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
42 | #include <qpe/storage.h> | 42 | #include <qpe/storage.h> |
43 | 43 | ||
44 | /* QT */ | 44 | /* QT */ |
45 | #include <qcombobox.h> | 45 | #include <qcombobox.h> |
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qhbox.h> | 47 | #include <qhbox.h> |
48 | #include <qheader.h> | 48 | #include <qheader.h> |
49 | #include <qlabel.h> | 49 | #include <qlabel.h> |
50 | #include <qlayout.h> | 50 | #include <qlayout.h> |
51 | #include <qlineedit.h> | 51 | #include <qlineedit.h> |
52 | #include <qlistview.h> | 52 | #include <qlistview.h> |
53 | #include <qpopupmenu.h> | 53 | #include <qpopupmenu.h> |
54 | #include <qwidgetstack.h> | 54 | #include <qwidgetstack.h> |
55 | #include <qregexp.h> | 55 | #include <qregexp.h> |
56 | #include <qobjectlist.h> | 56 | #include <qobjectlist.h> |
57 | 57 | ||
58 | using namespace Opie; | 58 | using namespace Opie::Ui::Private; |
59 | 59 | ||
60 | namespace Opie { | ||
61 | namespace Ui { | ||
62 | namespace Private { | ||
60 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) | 63 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) |
61 | : m_selector( selector ) | 64 | : m_selector( selector ) |
62 | {} | 65 | {} |
63 | 66 | ||
64 | OFileViewInterface::~OFileViewInterface() | 67 | OFileViewInterface::~OFileViewInterface() |
65 | {} | 68 | {} |
66 | 69 | ||
67 | QString OFileViewInterface::name()const | 70 | QString OFileViewInterface::name()const |
68 | { | 71 | { |
69 | return m_name; | 72 | return m_name; |
70 | } | 73 | } |
71 | 74 | ||
72 | void OFileViewInterface::setName( const QString& name ) | 75 | void OFileViewInterface::setName( const QString& name ) |
73 | { | 76 | { |
74 | m_name = name; | 77 | m_name = name; |
75 | } | 78 | } |
76 | 79 | ||
77 | OFileSelector* OFileViewInterface::selector()const | 80 | OFileSelector* OFileViewInterface::selector()const |
78 | { | 81 | { |
79 | return m_selector; | 82 | return m_selector; |
80 | } | 83 | } |
81 | 84 | ||
82 | DocLnk OFileViewInterface::selectedDocument()const | 85 | DocLnk OFileViewInterface::selectedDocument()const |
83 | { | 86 | { |
@@ -789,48 +792,50 @@ void OFileViewFileSystem::reread() | |||
789 | m_view->reread( m_all ); | 792 | m_view->reread( m_all ); |
790 | } | 793 | } |
791 | 794 | ||
792 | int OFileViewFileSystem::fileCount()const | 795 | int OFileViewFileSystem::fileCount()const |
793 | { | 796 | { |
794 | if (!m_view ) | 797 | if (!m_view ) |
795 | return -1; | 798 | return -1; |
796 | return m_view->fileCount(); | 799 | return m_view->fileCount(); |
797 | } | 800 | } |
798 | 801 | ||
799 | QWidget* OFileViewFileSystem::widget( QWidget* parent ) | 802 | QWidget* OFileViewFileSystem::widget( QWidget* parent ) |
800 | { | 803 | { |
801 | if (!m_view ) | 804 | if (!m_view ) |
802 | { | 805 | { |
803 | m_view = new OFileViewFileListView( parent, startDirectory(), selector() ); | 806 | m_view = new OFileViewFileListView( parent, startDirectory(), selector() ); |
804 | } | 807 | } |
805 | return m_view; | 808 | return m_view; |
806 | } | 809 | } |
807 | 810 | ||
808 | void OFileViewFileSystem::activate( const QString& str) | 811 | void OFileViewFileSystem::activate( const QString& str) |
809 | { | 812 | { |
810 | m_all = (str != QObject::tr("Files") ); | 813 | m_all = (str != QObject::tr("Files") ); |
811 | } | 814 | } |
812 | 815 | ||
816 | |||
817 | } | ||
813 | /* Selector */ | 818 | /* Selector */ |
814 | /** | 819 | /** |
815 | * @short new and complete c'tor | 820 | * @short new and complete c'tor |
816 | * | 821 | * |
817 | * Create a OFileSelector to let the user select a file. It can | 822 | * Create a OFileSelector to let the user select a file. It can |
818 | * either be used to open a file, select a save name in a dir or | 823 | * either be used to open a file, select a save name in a dir or |
819 | * as a dropin for the FileSelector. | 824 | * as a dropin for the FileSelector. |
820 | * | 825 | * |
821 | * <pre> | 826 | * <pre> |
822 | * QMap<QString, QStringList> mimeTypes; | 827 | * QMap<QString, QStringList> mimeTypes; |
823 | * QStringList types; | 828 | * QStringList types; |
824 | * types << "text@slash* "; | 829 | * types << "text@slash* "; |
825 | * types << "audio@slash*"; | 830 | * types << "audio@slash*"; |
826 | * mimeTypes.insert( tr("Audio and Text"), types ); | 831 | * mimeTypes.insert( tr("Audio and Text"), types ); |
827 | * mimeTypes.insert( tr("All"), "*@slash*); | 832 | * mimeTypes.insert( tr("All"), "*@slash*); |
828 | * | 833 | * |
829 | * now you could create your fileselector | 834 | * now you could create your fileselector |
830 | * </pre> | 835 | * </pre> |
831 | * | 836 | * |
832 | * | 837 | * |
833 | * @param parent the parent of this widget | 838 | * @param parent the parent of this widget |
834 | * @param mode The mode from the enum Mode (Open,Save,FILESELECTOR) | 839 | * @param mode The mode from the enum Mode (Open,Save,FILESELECTOR) |
835 | * @param sel The selector to be used | 840 | * @param sel The selector to be used |
836 | * @param dirName The name of the dir to start int | 841 | * @param dirName The name of the dir to start int |
@@ -1143,24 +1148,26 @@ void OFileSelector::slotViewChange( const QString& view ) | |||
1143 | 1148 | ||
1144 | id++; | 1149 | id++; |
1145 | } | 1150 | } |
1146 | 1151 | ||
1147 | void OFileSelector::setNewVisible( bool b ) | 1152 | void OFileSelector::setNewVisible( bool b ) |
1148 | { | 1153 | { |
1149 | m_shNew = b; | 1154 | m_shNew = b; |
1150 | currentView()->reread(); | 1155 | currentView()->reread(); |
1151 | } | 1156 | } |
1152 | 1157 | ||
1153 | void OFileSelector::setCloseVisible( bool b ) | 1158 | void OFileSelector::setCloseVisible( bool b ) |
1154 | { | 1159 | { |
1155 | m_shClose = b; | 1160 | m_shClose = b; |
1156 | currentView()->reread(); | 1161 | currentView()->reread(); |
1157 | } | 1162 | } |
1158 | 1163 | ||
1159 | void OFileSelector::setNameVisible( bool b ) | 1164 | void OFileSelector::setNameVisible( bool b ) |
1160 | { | 1165 | { |
1161 | if ( b ) | 1166 | if ( b ) |
1162 | m_nameBox->show(); | 1167 | m_nameBox->show(); |
1163 | else | 1168 | else |
1164 | m_nameBox->hide(); | 1169 | m_nameBox->hide(); |
1165 | } | 1170 | } |
1166 | 1171 | ||
1172 | } | ||
1173 | } | ||