-rw-r--r-- | libopie/ofileselector.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h index 5c38ac4..47697b9 100644 --- a/libopie/ofileselector.h +++ b/libopie/ofileselector.h | |||
@@ -62,8 +62,9 @@ class QWidgetStack; | |||
62 | class QHBoxLayout; | 62 | class QHBoxLayout; |
63 | class QVBoxLayout; | 63 | class QVBoxLayout; |
64 | class QPopupMenu; | 64 | class QPopupMenu; |
65 | class QFileInfo; | 65 | class QFileInfo; |
66 | class QHBox; | ||
66 | // | 67 | // |
67 | 68 | ||
68 | 69 | ||
69 | class OFileSelector : public QWidget { | 70 | class OFileSelector : public QWidget { |
@@ -80,19 +81,19 @@ class OFileSelector : public QWidget { | |||
80 | 81 | ||
81 | 82 | ||
82 | OFileSelector(const QString &mimeFilter, QWidget *parent, | 83 | OFileSelector(const QString &mimeFilter, QWidget *parent, |
83 | const char *name, bool newVisible = TRUE, | 84 | const char *name, bool newVisible = TRUE, |
84 | bool closeVisible = FALSE ) { }; | 85 | bool closeVisible = FALSE ); |
85 | 86 | ||
86 | ~OFileSelector() {}; | 87 | ~OFileSelector(); |
87 | 88 | ||
88 | // currently only for the FILESELECTOR Mode | 89 | // currently only for the FILESELECTOR Mode |
89 | void setNewVisible( bool /*b*/ ) { }; | 90 | void setNewVisible( bool /*b*/ ); |
90 | void setCloseVisible(bool /*b*/ ) { }; | 91 | void setCloseVisible(bool /*b*/ ); |
91 | 92 | ||
92 | // end file selector mode | 93 | // end file selector mode |
93 | // deprecated | 94 | // deprecated |
94 | void reread() { reparse(); }; | 95 | void reread(); |
95 | // make sure not to leak please | 96 | // make sure not to leak please |
96 | const DocLnk *selected(); | 97 | const DocLnk *selected(); |
97 | // end deprecated | 98 | // end deprecated |
98 | 99 | ||
@@ -133,9 +134,9 @@ class OFileSelector : public QWidget { | |||
133 | bool showPopup()const { return m_showPopup; }; | 134 | bool showPopup()const { return m_showPopup; }; |
134 | void setShowPopup( bool pop ) { m_showPopup = pop; }; | 135 | void setShowPopup( bool pop ) { m_showPopup = pop; }; |
135 | void setPopupMenu( QPopupMenu * ); | 136 | void setPopupMenu( QPopupMenu * ); |
136 | 137 | ||
137 | void updateLay(); | 138 | // void updateLay(); |
138 | 139 | ||
139 | void reparse(); // re reads the dir | 140 | void reparse(); // re reads the dir |
140 | 141 | ||
141 | QString selectedName( )const; | 142 | QString selectedName( )const; |
@@ -158,18 +159,21 @@ class OFileSelector : public QWidget { | |||
158 | void dirSelected(const QString &dir ); | 159 | void dirSelected(const QString &dir ); |
159 | void closeMe(); | 160 | void closeMe(); |
160 | void ok(); | 161 | void ok(); |
161 | void cancel(); | 162 | void cancel(); |
163 | void contextMenu(); | ||
162 | 164 | ||
163 | protected slots: | 165 | private slots: |
166 | void slotTest() { qWarning("slotTest" ); setLineEditVisible(false ); }; | ||
164 | void slotOk(); | 167 | void slotOk(); |
165 | void slotCancel(); | 168 | void slotCancel(); |
166 | void slotViewCheck(const QString & ); | 169 | void slotViewCheck(const QString & ); |
167 | void slotMimeCheck(const QString & ); | 170 | void slotMimeCheck(const QString & ); |
168 | void locationComboActivated(const QString & ); | 171 | void slotLocationActivated(const QString & ); |
169 | void insertLocationPath(const QString &, int); | 172 | void slotInsertLocationPath(const QString &, int); |
170 | void locationComboChanged(); | 173 | void locationComboChanged(); |
171 | protected: | 174 | |
175 | private: | ||
172 | void init(); | 176 | void init(); |
173 | void updateMimes(); | 177 | void updateMimes(); |
174 | 178 | ||
175 | protected: | 179 | protected: |
@@ -177,27 +181,27 @@ class OFileSelector : public QWidget { | |||
177 | private: | 181 | private: |
178 | int m_mode, m_selector; | 182 | int m_mode, m_selector; |
179 | QComboBox *m_location, *m_mimeCheck, *m_viewCheck; | 183 | QComboBox *m_location, *m_mimeCheck, *m_viewCheck; |
180 | QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; | 184 | QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; |
181 | QPushButton *m_reread, *m_up; | 185 | QPushButton *m_reread, *m_up, *m_new, *m_close; |
182 | QListView *m_View; | 186 | QListView *m_View; |
183 | QCheckBox *m_checkPerm; | 187 | QCheckBox *m_checkPerm; |
184 | QWidget *m_pseudo; | 188 | QWidget *m_pseudo; |
185 | QVBoxLayout *m_pseudoLayout; | 189 | QVBoxLayout *m_pseudoLayout; |
186 | 190 | ||
187 | QString m_currentDir; | 191 | QString m_currentDir; |
188 | QString m_name; | 192 | QString m_name; |
189 | QStringList m_mimetypes, requestedMimeTypesList; | 193 | QStringList m_mimetypes; |
190 | 194 | ||
191 | FileSelector *m_select; | 195 | FileSelector *m_select; |
192 | QWidgetStack *m_stack; | 196 | QWidgetStack *m_stack; |
193 | QVBoxLayout *m_lay; | 197 | QVBoxLayout *m_lay; |
194 | QGridLayout *m_Oselector; | 198 | QGridLayout *m_Oselector; |
195 | 199 | ||
196 | QHBoxLayout *m_boxToolbar; | 200 | QHBox *m_boxToolbar; |
197 | QHBoxLayout *m_boxOk; | 201 | QHBox *m_boxOk; // (no layout anymore) wait |
198 | QHBoxLayout *m_boxName; | 202 | QHBox *m_boxName; // (no Layout anymore) wait |
199 | QHBoxLayout *m_boxView; | 203 | QHBox *m_boxView; |
200 | 204 | ||
201 | QPopupMenu *m_custom; | 205 | QPopupMenu *m_custom; |
202 | 206 | ||
203 | QLineEdit *m_edit; | 207 | QLineEdit *m_edit; |
@@ -216,17 +220,18 @@ class OFileSelector : public QWidget { | |||
216 | bool m_dir : 1; | 220 | bool m_dir : 1; |
217 | bool m_files : 1; | 221 | bool m_files : 1; |
218 | bool m_showPopup : 1; | 222 | bool m_showPopup : 1; |
219 | 223 | ||
220 | // implementation todo | 224 | void initVars(); |
221 | virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); | 225 | virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); |
222 | virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE ); | 226 | virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE ); |
223 | virtual void addSymlink(const QString &, QFileInfo *, bool = FALSE ){}; | 227 | virtual void addSymlink(const QString &, QFileInfo *, bool = FALSE ){}; |
224 | void delItems(); | 228 | void delItems(); |
225 | void initializeName(); | 229 | void initializeName(); |
226 | void initializeYes(); | 230 | void initializeYes(); |
227 | void initializeChooser(); | 231 | void initializeChooser(); |
228 | void initializeListView(); | 232 | void initializeListView(); |
233 | void initializePerm(); | ||
229 | void initPics(); | 234 | void initPics(); |
230 | bool compliesMime(const QString &path, const QString &mime); | 235 | bool compliesMime(const QString &path, const QString &mime); |
231 | 236 | ||
232 | class OFileSelectorPrivate; | 237 | class OFileSelectorPrivate; |