-rw-r--r-- | libopie/libopie.pro | 28 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.cpp | 8 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.h | 3 | ||||
-rw-r--r-- | libopie/ofileselector/ofiledialog.cpp | 2 | ||||
-rw-r--r-- | libopie/ofileselector/ofiledialog.h | 3 | ||||
-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 8 | ||||
-rw-r--r-- | libopie/todayplugininterface.h | 6 |
7 files changed, 51 insertions, 7 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index df9c40a..a216cca 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro | |||
@@ -1,67 +1,91 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qte warn_on release | 2 | CONFIG += qte warn_on release |
3 | HEADERS = ofontmenu.h \ | 3 | HEADERS = ofontmenu.h \ |
4 | ocolorbutton.h \ | 4 | ocolorbutton.h \ |
5 | ofiledialog.h ofileselector.h tododb.h \ | 5 | ofileselector/odefaultfactories.h \ |
6 | ofileselector/ofiledialog.h \ | ||
7 | ofileselector/ofilelistview.h \ | ||
8 | ofileselector/ofileiconview.h \ | ||
9 | ofileselector/ofileselector.h \ | ||
10 | ofileselector/ofileselectoritem.h \ | ||
11 | ofileselector/ofileselectoriconitem.h \ | ||
12 | ofileselector/ofileselectormain.h \ | ||
13 | ofileselector/ofileview.h \ | ||
14 | ofileselector/olister.h \ | ||
15 | ofileselector/olocallister.h \ | ||
16 | ofileselector/opixmapprovider.h \ | ||
17 | tododb.h \ | ||
6 | ocheckitem.h todoevent.h todoresource.h \ | 18 | ocheckitem.h todoevent.h todoresource.h \ |
7 | todovcalresource.h xmltree.h \ | 19 | todovcalresource.h xmltree.h \ |
8 | colordialog.h colorpopupmenu.h \ | 20 | colordialog.h colorpopupmenu.h \ |
9 | oclickablelabel.h oprocctrl.h \ | 21 | oclickablelabel.h oprocctrl.h \ |
10 | oprocess.h odevice.h \ | 22 | oprocess.h odevice.h \ |
11 | otimepicker.h otabwidget.h \ | 23 | otimepicker.h otabwidget.h \ |
12 | otabbar.h otabinfo.h \ | 24 | otabbar.h otabinfo.h \ |
13 | ofontselector.h \ | 25 | ofontselector.h \ |
14 | pim/opimrecord.h \ | 26 | pim/opimrecord.h \ |
15 | pim/otodo.h \ | 27 | pim/otodo.h \ |
16 | pim/orecordlist.h \ | 28 | pim/orecordlist.h \ |
17 | pim/opimaccesstemplate.h \ | 29 | pim/opimaccesstemplate.h \ |
18 | pim/opimaccessbackend.h \ | 30 | pim/opimaccessbackend.h \ |
19 | pim/otodoaccess.h \ | 31 | pim/otodoaccess.h \ |
20 | pim/otodacessbackend.h \ | 32 | pim/otodacessbackend.h \ |
21 | pim/ocontact.h \ | 33 | pim/ocontact.h \ |
22 | pim/ocontactaccess.h \ | 34 | pim/ocontactaccess.h \ |
23 | pim/ocontactaccessbackend.h \ | 35 | pim/ocontactaccessbackend.h \ |
24 | pim/ocontactaccessbackend_xml.h \ | 36 | pim/ocontactaccessbackend_xml.h \ |
25 | pim/obackendfactory.h \ | 37 | pim/obackendfactory.h \ |
26 | pim/opimcache.h \ | 38 | pim/opimcache.h \ |
27 | pim/otodoaccessvcal.h \ | 39 | pim/otodoaccessvcal.h \ |
28 | pim/orecur.h \ | 40 | pim/orecur.h \ |
29 | orecurrancewidget.h | 41 | orecurrancewidget.h |
30 | # pim/otodoaccesssql.h \ | 42 | # pim/otodoaccesssql.h \ |
31 | 43 | ||
32 | SOURCES = ofontmenu.cc \ | 44 | SOURCES = ofontmenu.cc \ |
33 | ocolorbutton.cpp \ | 45 | ocolorbutton.cpp \ |
46 | ofileselector/odefaultfactories.cpp \ | ||
47 | ofileselector/ofiledialog.cpp \ | ||
48 | ofileselector/ofilefactory.cpp \ | ||
49 | ofileselector/ofilelistview.cpp \ | ||
50 | ofileselector/ofileiconview.cpp \ | ||
51 | ofileselector/ofileselector.cpp \ | ||
52 | ofileselector/ofileselectoritem.cpp \ | ||
53 | ofileselector/ofileselectoriconitem.cpp \ | ||
54 | ofileselector/ofileselectormain.cpp \ | ||
55 | ofileselector/ofileview.cpp \ | ||
56 | ofileselector/olister.cpp \ | ||
57 | ofileselector/olocallister.cpp \ | ||
58 | ofileselector/opixmapprovider.cpp \ | ||
34 | xmltree.cc \ | 59 | xmltree.cc \ |
35 | ofiledialog.cc ofileselector.cc \ | ||
36 | ocheckitem.cpp tododb.cpp todoevent.cpp \ | 60 | ocheckitem.cpp tododb.cpp todoevent.cpp \ |
37 | todovcalresource.cpp colordialog.cpp \ | 61 | todovcalresource.cpp colordialog.cpp \ |
38 | colorpopupmenu.cpp oclickablelabel.cpp \ | 62 | colorpopupmenu.cpp oclickablelabel.cpp \ |
39 | oprocctrl.cpp oprocess.cpp \ | 63 | oprocctrl.cpp oprocess.cpp \ |
40 | odevice.cpp otimepicker.cpp \ | 64 | odevice.cpp otimepicker.cpp \ |
41 | otabwidget.cpp otabbar.cpp \ | 65 | otabwidget.cpp otabbar.cpp \ |
42 | ofontselector.cpp \ | 66 | ofontselector.cpp \ |
43 | pim/otodo.cpp \ | 67 | pim/otodo.cpp \ |
44 | pim/opimrecord.cpp \ | 68 | pim/opimrecord.cpp \ |
45 | pim/otodoaccess.cpp \ | 69 | pim/otodoaccess.cpp \ |
46 | pim/otodoaccessbackend.cpp \ | 70 | pim/otodoaccessbackend.cpp \ |
47 | pim/otodoaccessxml.cpp \ | 71 | pim/otodoaccessxml.cpp \ |
48 | pim/ocontact.cpp \ | 72 | pim/ocontact.cpp \ |
49 | pim/ocontactaccess.cpp \ | 73 | pim/ocontactaccess.cpp \ |
50 | pim/otodoaccessvcal.cpp \ | 74 | pim/otodoaccessvcal.cpp \ |
51 | pim/orecur.cpp \ | 75 | pim/orecur.cpp \ |
52 | orecurrancewidget.cpp | 76 | orecurrancewidget.cpp |
53 | # pim/otodoaccesssql.cpp \ | 77 | # pim/otodoaccesssql.cpp \ |
54 | 78 | ||
55 | TARGET = opie | 79 | TARGET = opie |
56 | INCLUDEPATH += $(OPIEDIR)/include | 80 | INCLUDEPATH += $(OPIEDIR)/include |
57 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 81 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
58 | #VERSION = 1.0.0 | 82 | #VERSION = 1.0.0 |
59 | 83 | ||
60 | # LIBS += -lopiesql | 84 | # LIBS += -lopiesql |
61 | 85 | ||
62 | INTERFACES = otimepickerbase.ui orecurrancebase.ui | 86 | INTERFACES = otimepickerbase.ui orecurrancebase.ui |
63 | 87 | ||
64 | TRANSLATIONS = ../i18n/de/libopie.ts \ | 88 | TRANSLATIONS = ../i18n/de/libopie.ts \ |
65 | ../i18n/en/libopie.ts \ | 89 | ../i18n/en/libopie.ts \ |
66 | ../i18n/es/libopie.ts \ | 90 | ../i18n/es/libopie.ts \ |
67 | ../i18n/fr/libopie.ts \ | 91 | ../i18n/fr/libopie.ts \ |
diff --git a/libopie/ofileselector/odefaultfactories.cpp b/libopie/ofileselector/odefaultfactories.cpp index c41fbca..c8efffb 100644 --- a/libopie/ofileselector/odefaultfactories.cpp +++ b/libopie/ofileselector/odefaultfactories.cpp | |||
@@ -1,15 +1,23 @@ | |||
1 | #include "ofilelistview.h" | 1 | #include "ofilelistview.h" |
2 | #include "ofileiconview.h" | ||
2 | #include "olocallister.h" | 3 | #include "olocallister.h" |
3 | 4 | ||
5 | |||
4 | #include "odefaultfactories.h" | 6 | #include "odefaultfactories.h" |
5 | 7 | ||
6 | extern "C" { | 8 | extern "C" { |
7 | 9 | ||
10 | |||
11 | OFileView* newFileIconView( OFileSelector* sel, QWidget* parent ) { | ||
12 | return new OFileIconView( parent, sel ); | ||
13 | } | ||
14 | |||
8 | OFileView* newFileListView( OFileSelector* sel, QWidget* par ) { | 15 | OFileView* newFileListView( OFileSelector* sel, QWidget* par ) { |
9 | return new OFileListView(par, sel ); | 16 | return new OFileListView(par, sel ); |
10 | } | 17 | } |
18 | |||
11 | OLister* newLocalLister( OFileSelector* sel) { | 19 | OLister* newLocalLister( OFileSelector* sel) { |
12 | return new OLocalLister( sel ); | 20 | return new OLocalLister( sel ); |
13 | } | 21 | } |
14 | 22 | ||
15 | }; | 23 | }; |
diff --git a/libopie/ofileselector/odefaultfactories.h b/libopie/ofileselector/odefaultfactories.h index eb698d3..b4c35af 100644 --- a/libopie/ofileselector/odefaultfactories.h +++ b/libopie/ofileselector/odefaultfactories.h | |||
@@ -1,14 +1,17 @@ | |||
1 | #ifndef OPIE_DEFAULT_FACTORIES_H | 1 | #ifndef OPIE_DEFAULT_FACTORIES_H |
2 | #define OPIE_DEFAULT_FACTORIES_H | 2 | #define OPIE_DEFAULT_FACTORIES_H |
3 | 3 | ||
4 | #include "ofilefactory.h" | 4 | #include "ofilefactory.h" |
5 | 5 | ||
6 | extern "C" { | 6 | extern "C" { |
7 | 7 | ||
8 | OFileView* newFileIconView( OFileSelector*, QWidget* parent ); | ||
8 | OFileView* newFileListView( OFileSelector*, QWidget* parent ); | 9 | OFileView* newFileListView( OFileSelector*, QWidget* parent ); |
10 | |||
9 | OLister* newLocalLister(OFileSelector* ); | 11 | OLister* newLocalLister(OFileSelector* ); |
10 | 12 | ||
13 | |||
11 | }; | 14 | }; |
12 | 15 | ||
13 | 16 | ||
14 | #endif | 17 | #endif |
diff --git a/libopie/ofileselector/ofiledialog.cpp b/libopie/ofileselector/ofiledialog.cpp index 430def2..d137c66 100644 --- a/libopie/ofileselector/ofiledialog.cpp +++ b/libopie/ofileselector/ofiledialog.cpp | |||
@@ -55,62 +55,62 @@ OFileDialog::OFileDialog(const QString &caption, | |||
55 | this, SLOT(slotFileSelected(const QString&) ) ); | 55 | this, SLOT(slotFileSelected(const QString&) ) ); |
56 | 56 | ||
57 | connect(file, SIGNAL(dirSelected(const QString &) ), | 57 | connect(file, SIGNAL(dirSelected(const QString &) ), |
58 | this, SLOT(slotDirSelected(const QString &) ) ); | 58 | this, SLOT(slotDirSelected(const QString &) ) ); |
59 | 59 | ||
60 | 60 | ||
61 | file->setYesCancelVisible( false ); // relayout | 61 | file->setYesCancelVisible( false ); // relayout |
62 | } | 62 | } |
63 | QString OFileDialog::mimetype()const | 63 | QString OFileDialog::mimetype()const |
64 | { | 64 | { |
65 | return QString::null; | 65 | return QString::null; |
66 | } | 66 | } |
67 | QString OFileDialog::fileName()const | 67 | QString OFileDialog::fileName()const |
68 | { | 68 | { |
69 | return file->selectedName(); | 69 | return file->selectedName(); |
70 | } | 70 | } |
71 | DocLnk OFileDialog::selectedDocument()const | 71 | DocLnk OFileDialog::selectedDocument()const |
72 | { | 72 | { |
73 | return file->selectedDocument(); | 73 | return file->selectedDocument(); |
74 | } | 74 | } |
75 | QString OFileDialog::getOpenFileName(int selector, | 75 | QString OFileDialog::getOpenFileName(int selector, |
76 | const QString &startDir, | 76 | const QString &startDir, |
77 | const QString &file, | 77 | const QString &file, |
78 | const MimeTypes &mimes, | 78 | const MimeTypes &mimes, |
79 | QWidget *wid, | 79 | QWidget *wid, |
80 | const QString &caption ) | 80 | const QString &caption ) |
81 | { | 81 | { |
82 | QString ret; | 82 | QString ret; |
83 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, | 83 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, |
84 | wid, OFileSelector::Open, selector, startDir, file, mimes); | 84 | wid, OFileSelector::Open, selector, startDir, file, mimes); |
85 | dlg.showMaximized(); | 85 | dlg.showMaximized(); |
86 | if( dlg.exec() ) | 86 | if( dlg.exec() ) |
87 | ret = dlg.fileName(); | 87 | ret = dlg.fileName(); |
88 | 88 | ||
89 | return ret; | 89 | return ret; |
90 | } | 90 | } |
91 | QString OFileDialog::getSaveFileName(int selector, | 91 | QString OFileDialog::getSaveFileName(int selector, |
92 | const QString &startDir, | 92 | const QString &startDir, |
93 | const QString &file, | 93 | const QString &file, |
94 | const MimeTypes &mimes, | 94 | const MimeTypes &mimes, |
95 | QWidget *wid, | 95 | QWidget *wid, |
96 | const QString &caption ) | 96 | const QString &caption ) |
97 | { | 97 | { |
98 | QString ret; | 98 | QString ret; |
99 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, | 99 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, |
100 | wid, OFileSelector::Save, selector, startDir, file, mimes); | 100 | wid, OFileSelector::Save, selector, startDir, file, mimes); |
101 | dlg.showMaximized(); | 101 | dlg.showMaximized(); |
102 | if( dlg.exec() ) | 102 | if( dlg.exec() ) |
103 | ret = dlg.fileName(); | 103 | ret = dlg.fileName(); |
104 | 104 | ||
105 | return ret; | 105 | return ret; |
106 | } | 106 | } |
107 | 107 | ||
108 | void OFileDialog::slotFileSelected(const QString & ) | 108 | void OFileDialog::slotFileSelected(const QString & ) |
109 | { | 109 | { |
110 | accept(); | 110 | accept(); |
111 | } | 111 | } |
112 | void OFileDialog::slotDirSelected(const QString & ) | 112 | void OFileDialog::slotDirSelected(const QString & ) |
113 | { | 113 | { |
114 | // if mode | 114 | // if mode |
115 | //accept(); | 115 | //accept(); |
116 | } | 116 | } |
diff --git a/libopie/ofileselector/ofiledialog.h b/libopie/ofileselector/ofiledialog.h index e14253c..e368e96 100644 --- a/libopie/ofileselector/ofiledialog.h +++ b/libopie/ofileselector/ofiledialog.h | |||
@@ -3,65 +3,66 @@ | |||
3 | .=l. Copyright (c) 2002 zecke <zecke@handhelds.org> | 3 | .=l. Copyright (c) 2002 zecke <zecke@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | #ifndef OpieFileDialog_h | 30 | #ifndef OpieFileDialog_h |
31 | #define OpieFileDialog_h | 31 | #define OpieFileDialog_h |
32 | 32 | ||
33 | #include <qdialog.h> | 33 | #include <qdialog.h> |
34 | 34 | ||
35 | #include <opie/ofileselector.h> | 35 | //#include <opie/ofileselector.h> |
36 | #include "ofileselector.h" | ||
36 | 37 | ||
37 | class OFileDialog : public QDialog { | 38 | class OFileDialog : public QDialog { |
38 | Q_OBJECT | 39 | Q_OBJECT |
39 | public: | 40 | public: |
40 | OFileDialog(const QString &caption, | 41 | OFileDialog(const QString &caption, |
41 | QWidget *, int mode, int selector, | 42 | QWidget *, int mode, int selector, |
42 | const QString &dirName, | 43 | const QString &dirName, |
43 | const QString &fileName = QString::null, | 44 | const QString &fileName = QString::null, |
44 | const MimeTypes &mimetypes = MimeTypes() ); | 45 | const MimeTypes &mimetypes = MimeTypes() ); |
45 | QString mimetype() const; | 46 | QString mimetype() const; |
46 | QString fileName() const; | 47 | QString fileName() const; |
47 | DocLnk selectedDocument()const; | 48 | DocLnk selectedDocument()const; |
48 | 49 | ||
49 | // static methods | 50 | // static methods |
50 | static QString getOpenFileName(int selector, | 51 | static QString getOpenFileName(int selector, |
51 | const QString& startDir = QString::null, | 52 | const QString& startDir = QString::null, |
52 | const QString &fileName = QString::null, | 53 | const QString &fileName = QString::null, |
53 | const MimeTypes& mime = MimeTypes(), | 54 | const MimeTypes& mime = MimeTypes(), |
54 | QWidget *wid = 0, | 55 | QWidget *wid = 0, |
55 | const QString &caption = QString::null ); | 56 | const QString &caption = QString::null ); |
56 | 57 | ||
57 | static QString getSaveFileName(int selector, | 58 | static QString getSaveFileName(int selector, |
58 | const QString& startDir = QString::null, | 59 | const QString& startDir = QString::null, |
59 | const QString& fileName = QString::null, | 60 | const QString& fileName = QString::null, |
60 | const MimeTypes& mimefilter = MimeTypes(), | 61 | const MimeTypes& mimefilter = MimeTypes(), |
61 | QWidget *wid = 0, | 62 | QWidget *wid = 0, |
62 | const QString &caption = QString::null ); | 63 | const QString &caption = QString::null ); |
63 | 64 | ||
64 | //let's OFileSelector catch up first | 65 | //let's OFileSelector catch up first |
65 | //static QString getExistingDirectory(const QString& startDir = QString::null, | 66 | //static QString getExistingDirectory(const QString& startDir = QString::null, |
66 | // QWidget *parent = 0, | 67 | // QWidget *parent = 0, |
67 | // const QString& caption = QString::null ); | 68 | // const QString& caption = QString::null ); |
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index 9ce07dd..c6e923f 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp | |||
@@ -456,64 +456,66 @@ void OFileSelector::init() | |||
456 | 456 | ||
457 | /* take care of the main view... */ | 457 | /* take care of the main view... */ |
458 | initToolbar(); | 458 | initToolbar(); |
459 | //if( m_shChooser ) // the Chooser for the view and Mimetypes | 459 | //if( m_shChooser ) // the Chooser for the view and Mimetypes |
460 | initializeChooser(); | 460 | initializeChooser(); |
461 | 461 | ||
462 | /* initialize the file lister */ | 462 | /* initialize the file lister */ |
463 | if( m_selector == Normal ){ | 463 | if( m_selector == Normal ){ |
464 | QString mime; | 464 | QString mime; |
465 | if (!m_autoMime) { | 465 | if (!m_autoMime) { |
466 | if (!m_mimetypes.isEmpty() ) { | 466 | if (!m_mimetypes.isEmpty() ) { |
467 | QMap<QString, QStringList>::Iterator it; | 467 | QMap<QString, QStringList>::Iterator it; |
468 | it = m_mimetypes.begin(); // cause we're in the init | 468 | it = m_mimetypes.begin(); // cause we're in the init |
469 | mime = it.data().join(";"); | 469 | mime = it.data().join(";"); |
470 | } | 470 | } |
471 | } | 471 | } |
472 | initializeOldSelector(); | 472 | initializeOldSelector(); |
473 | }else{ | 473 | }else{ |
474 | initializeView(); | 474 | initializeView(); |
475 | } | 475 | } |
476 | 476 | ||
477 | if( m_shLne ) // the LineEdit with the current FileName | 477 | if( m_shLne ) // the LineEdit with the current FileName |
478 | initializeName(); | 478 | initializeName(); |
479 | 479 | ||
480 | if( m_shPerm ) // the Permission QCheckBox | 480 | if( m_shPerm ) // the Permission QCheckBox |
481 | initializePerm(); | 481 | initializePerm(); |
482 | 482 | ||
483 | if( m_shYesNo ) // the Yes No button row | 483 | if( m_shYesNo ) // the Yes No button row |
484 | initializeYes( ); | 484 | initializeYes( ); |
485 | 485 | ||
486 | if (m_selector != Normal ) | 486 | if (m_selector != Normal ) |
487 | reparse(); | 487 | reparse(); |
488 | |||
489 | showMaximized(); | ||
488 | } | 490 | } |
489 | void OFileSelector::updateMimes() | 491 | void OFileSelector::updateMimes() |
490 | { | 492 | { |
491 | if( m_autoMime ){ | 493 | if( m_autoMime ){ |
492 | m_mimetypes.clear(); | 494 | m_mimetypes.clear(); |
493 | m_mimetypes.insert( tr("All"), QString::null ); | 495 | m_mimetypes.insert( tr("All"), QString::null ); |
494 | if( m_selector == Normal ){ | 496 | if( m_selector == Normal ){ |
495 | DocLnkSet set; | 497 | DocLnkSet set; |
496 | Global::findDocuments(&set, QString::null ); | 498 | Global::findDocuments(&set, QString::null ); |
497 | QListIterator<DocLnk> dit( set.children() ); | 499 | QListIterator<DocLnk> dit( set.children() ); |
498 | for( ; dit.current(); ++dit ){ | 500 | for( ; dit.current(); ++dit ){ |
499 | if( !m_mimetypes.contains( (*dit)->type() ) ) | 501 | if( !m_mimetypes.contains( (*dit)->type() ) ) |
500 | m_mimetypes.insert( (*dit)->type(), (*dit)->type() ); | 502 | m_mimetypes.insert( (*dit)->type(), (*dit)->type() ); |
501 | } | 503 | } |
502 | }// else done in reparse | 504 | }// else done in reparse |
503 | } | 505 | } |
504 | } | 506 | } |
505 | void OFileSelector::initVars() | 507 | void OFileSelector::initVars() |
506 | { | 508 | { |
507 | if( m_mimetypes.isEmpty() ) | 509 | if( m_mimetypes.isEmpty() ) |
508 | m_autoMime = true; | 510 | m_autoMime = true; |
509 | else | 511 | else |
510 | m_autoMime = false; | 512 | m_autoMime = false; |
511 | 513 | ||
512 | m_shClose = false; | 514 | m_shClose = false; |
513 | m_shNew = false; | 515 | m_shNew = false; |
514 | m_shTool = true; | 516 | m_shTool = true; |
515 | m_shPerm = false; | 517 | m_shPerm = false; |
516 | m_shLne = true; | 518 | m_shLne = true; |
517 | m_shChooser = true; | 519 | m_shChooser = true; |
518 | m_shYesNo = true; | 520 | m_shYesNo = true; |
519 | m_case = false; | 521 | m_case = false; |
@@ -622,65 +624,65 @@ void OFileSelector::updateMimeCheck() { | |||
622 | void OFileSelector::initializeChooser() | 624 | void OFileSelector::initializeChooser() |
623 | { | 625 | { |
624 | if( m_boxView == 0 ){ | 626 | if( m_boxView == 0 ){ |
625 | m_boxView = new QHBox( this ); | 627 | m_boxView = new QHBox( this ); |
626 | m_viewCheck = new QComboBox( m_boxView, "view check"); | 628 | m_viewCheck = new QComboBox( m_boxView, "view check"); |
627 | m_mimeCheck = new QComboBox( m_boxView, "mime check"); | 629 | m_mimeCheck = new QComboBox( m_boxView, "mime check"); |
628 | m_boxView->setSpacing( 8 ); | 630 | m_boxView->setSpacing( 8 ); |
629 | m_lay->addWidget(m_boxView, 0 ); | 631 | m_lay->addWidget(m_boxView, 0 ); |
630 | 632 | ||
631 | 633 | ||
632 | updateMimeCheck(); | 634 | updateMimeCheck(); |
633 | fillList(); | 635 | fillList(); |
634 | 636 | ||
635 | connect( m_viewCheck, SIGNAL( activated(const QString & ) ), | 637 | connect( m_viewCheck, SIGNAL( activated(const QString & ) ), |
636 | this, SLOT( slotViewCheck(const QString & ) ) ); | 638 | this, SLOT( slotViewCheck(const QString & ) ) ); |
637 | connect( m_mimeCheck, SIGNAL( activated(const QString & ) ), | 639 | connect( m_mimeCheck, SIGNAL( activated(const QString & ) ), |
638 | this, SLOT( slotMimeCheck( const QString & ) ) ); | 640 | this, SLOT( slotMimeCheck( const QString & ) ) ); |
639 | } | 641 | } |
640 | } | 642 | } |
641 | /* generate the buttons for the toolbar */ | 643 | /* generate the buttons for the toolbar */ |
642 | void OFileSelector::initToolbar() { | 644 | void OFileSelector::initToolbar() { |
643 | m_mainView = new OFileSelectorMain( this ); | 645 | m_mainView = new OFileSelectorMain( this ); |
644 | 646 | ||
645 | /* now generate the tool bar */ | 647 | /* now generate the tool bar */ |
646 | qWarning( "toolbar" ); | 648 | qWarning( "toolbar" ); |
647 | m_pseudo = new QWidget( m_mainView, "Pseudo Widget" ); | 649 | m_pseudo = new QWidget( m_mainView, "Pseudo Widget" ); |
648 | m_pseudoLayout = new QVBoxLayout( m_pseudo ); | 650 | m_pseudoLayout = new QVBoxLayout( m_pseudo ); |
649 | 651 | ||
650 | m_boxToolbar = new QHBox( m_pseudo ); | 652 | m_boxToolbar = new QHBox( m_pseudo ); |
651 | m_boxToolbar->setSpacing( 0 ); | 653 | m_boxToolbar->setSpacing( 0 ); |
652 | 654 | ||
653 | // tool bar members now | 655 | // tool bar members now |
654 | m_location = new QComboBox( m_boxToolbar ); | 656 | m_location = new QComboBox( m_boxToolbar ); |
655 | m_location->setEditable( TRUE ); | 657 | m_location->setEditable( TRUE ); |
656 | m_location->setDuplicatesEnabled( FALSE ); | 658 | m_location->setDuplicatesEnabled( FALSE ); |
657 | connect( m_location, SIGNAL(activated(const QString& ) ), | 659 | connect( m_location, SIGNAL(activated(const QString& ) ), |
658 | this, SLOT(slotLocationActivated(const QString& )) ); | 660 | this, SLOT(slotLocationActivated(const QString& )) ); |
659 | connect( m_location->lineEdit(), SIGNAL(returnPressed() ) , | 661 | connect( m_location->lineEdit(), SIGNAL(returnPressed() ) , |
660 | this, SLOT(locationComboChanged() ) ); | 662 | this, SLOT(locationComboChanged() ) ); |
661 | 663 | ||
662 | // UP Button | 664 | // UP Button |
663 | m_up = new QPushButton( Resource::loadIconSet("up"), QString::null, | 665 | m_up = new QPushButton( Resource::loadIconSet("up"), QString::null, |
664 | m_boxToolbar, "cdUpButton" ); | 666 | m_boxToolbar, "cdUpButton" ); |
665 | m_up->setFixedSize( QSize(20, 20 ) ); | 667 | m_up->setFixedSize( QSize(20, 20 ) ); |
666 | connect( m_up, SIGNAL( clicked() ), this, SLOT(cdUP() ) ); | 668 | connect( m_up, SIGNAL( clicked() ), this, SLOT(cdUP() ) ); |
667 | m_up->setFlat( TRUE ); | 669 | m_up->setFlat( TRUE ); |
668 | 670 | ||
669 | // Home Button | 671 | // Home Button |
670 | m_homeButton = new QPushButton(Resource::loadIconSet("home"), | 672 | m_homeButton = new QPushButton(Resource::loadIconSet("home"), |
671 | QString::null, m_boxToolbar ); | 673 | QString::null, m_boxToolbar ); |
672 | m_homeButton->setFixedSize( QSize(20, 20 ) ); | 674 | m_homeButton->setFixedSize( QSize(20, 20 ) ); |
673 | connect(m_homeButton, SIGNAL(clicked() ), this, SLOT(slotHome() ) ); | 675 | connect(m_homeButton, SIGNAL(clicked() ), this, SLOT(slotHome() ) ); |
674 | m_homeButton->setFlat( TRUE ); | 676 | m_homeButton->setFlat( TRUE ); |
675 | 677 | ||
676 | // Documents Button | 678 | // Documents Button |
677 | m_docButton = new QPushButton( Resource::loadIconSet("DocsIcon"), | 679 | m_docButton = new QPushButton( Resource::loadIconSet("DocsIcon"), |
678 | QString::null, m_boxToolbar, | 680 | QString::null, m_boxToolbar, |
679 | "docsButton" ); | 681 | "docsButton" ); |
680 | m_docButton->setFixedSize( QSize(20, 20 ) ); | 682 | m_docButton->setFixedSize( QSize(20, 20 ) ); |
681 | m_docButton->setFlat( true ); | 683 | m_docButton->setFlat( true ); |
682 | connect( m_docButton, SIGNAL(clicked() ), | 684 | connect( m_docButton, SIGNAL(clicked() ), |
683 | this, SLOT(slotDoc() ) ); | 685 | this, SLOT(slotDoc() ) ); |
684 | 686 | ||
685 | // close button | 687 | // close button |
686 | m_close = new QPushButton( Resource::loadIconSet( "close"), "", | 688 | m_close = new QPushButton( Resource::loadIconSet( "close"), "", |
@@ -945,67 +947,67 @@ void OFileSelector::setView( const QString& lis ) { | |||
945 | m_fileView = 0l; | 947 | m_fileView = 0l; |
946 | initializeOldSelector(); | 948 | initializeOldSelector(); |
947 | }else { | 949 | }else { |
948 | qWarning("lis %s", lis.latin1() ); | 950 | qWarning("lis %s", lis.latin1() ); |
949 | QString list; | 951 | QString list; |
950 | 952 | ||
951 | delete m_lister; | 953 | delete m_lister; |
952 | delete m_fileView; | 954 | delete m_fileView; |
953 | delete m_select; | 955 | delete m_select; |
954 | m_lister =0l; | 956 | m_lister =0l; |
955 | m_fileView = 0l; | 957 | m_fileView = 0l; |
956 | m_select = 0l; | 958 | m_select = 0l; |
957 | if ( lis.startsWith("All") ) { | 959 | if ( lis.startsWith("All") ) { |
958 | m_selector = ExtendedAll; | 960 | m_selector = ExtendedAll; |
959 | list = lis.mid(4 ).stripWhiteSpace(); | 961 | list = lis.mid(4 ).stripWhiteSpace(); |
960 | } else{ | 962 | } else{ |
961 | list = lis; | 963 | list = lis; |
962 | m_selector = Extended; | 964 | m_selector = Extended; |
963 | } | 965 | } |
964 | setLister(m_listerName); | 966 | setLister(m_listerName); |
965 | m_fileView = factory()->view( list, this, m_mainView ); | 967 | m_fileView = factory()->view( list, this, m_mainView ); |
966 | m_mainView->setWidget( m_fileView->widget() ); | 968 | m_mainView->setWidget( m_fileView->widget() ); |
967 | reparse(); | 969 | reparse(); |
968 | } | 970 | } |
969 | } | 971 | } |
970 | /* | 972 | /* |
971 | * the factory | 973 | * the factory |
972 | */ | 974 | */ |
973 | void OFileSelector::initFactory() { | 975 | void OFileSelector::initFactory() { |
974 | m_fileFactory = new OFileFactory(); | 976 | m_fileFactory = new OFileFactory(); |
975 | m_fileFactory->addLister(tr("Files"), newLocalLister ); | 977 | m_fileFactory->addLister(tr("Files"), newLocalLister ); |
976 | m_fileFactory->addView(tr("List View"), newFileListView ); | 978 | m_fileFactory->addView(tr("List View"), newFileListView ); |
977 | /* the factory is just a dummy */ | 979 | m_fileFactory->addView(tr("Documents"), newFileIconView ); |
978 | m_fileFactory->addView(tr("Documents"), newFileListView ); | ||
979 | } | 980 | } |
981 | |||
980 | void OFileSelector::fillList() { | 982 | void OFileSelector::fillList() { |
981 | qWarning("fill list"); | 983 | qWarning("fill list"); |
982 | if (!m_viewCheck ) | 984 | if (!m_viewCheck ) |
983 | return; | 985 | return; |
984 | 986 | ||
985 | m_viewCheck->clear(); | 987 | m_viewCheck->clear(); |
986 | QStringList list = factory()->views(); | 988 | QStringList list = factory()->views(); |
987 | qWarning("views: " + list.join(";") ); | 989 | qWarning("views: " + list.join(";") ); |
988 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 990 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
989 | qWarning( (*it) ); | 991 | qWarning( (*it) ); |
990 | if ( (*it) == tr("Documents") ) { | 992 | if ( (*it) == tr("Documents") ) { |
991 | m_viewCheck->insertItem( (*it) ); | 993 | m_viewCheck->insertItem( (*it) ); |
992 | }else{ | 994 | }else{ |
993 | m_viewCheck->insertItem( (*it) ); | 995 | m_viewCheck->insertItem( (*it) ); |
994 | m_viewCheck->insertItem( tr("All ") + (*it) ); | 996 | m_viewCheck->insertItem( tr("All ") + (*it) ); |
995 | } | 997 | } |
996 | } | 998 | } |
997 | } | 999 | } |
998 | OFileFactory* OFileSelector::factory() { | 1000 | OFileFactory* OFileSelector::factory() { |
999 | return m_fileFactory; | 1001 | return m_fileFactory; |
1000 | } | 1002 | } |
1001 | 1003 | ||
1002 | 1004 | ||
1003 | OFileView* OFileSelector::currentView() { | 1005 | OFileView* OFileSelector::currentView() { |
1004 | return m_fileView; | 1006 | return m_fileView; |
1005 | } | 1007 | } |
1006 | OFileView* OFileSelector::currentView() const{ | 1008 | OFileView* OFileSelector::currentView() const{ |
1007 | return m_fileView; | 1009 | return m_fileView; |
1008 | } | 1010 | } |
1009 | int OFileSelector::filter() { | 1011 | int OFileSelector::filter() { |
1010 | int filter; | 1012 | int filter; |
1011 | if ( m_selector == ExtendedAll ) | 1013 | if ( m_selector == ExtendedAll ) |
diff --git a/libopie/todayplugininterface.h b/libopie/todayplugininterface.h index becb79c..b37a3ab 100644 --- a/libopie/todayplugininterface.h +++ b/libopie/todayplugininterface.h | |||
@@ -30,50 +30,56 @@ public: | |||
30 | */ | 30 | */ |
31 | virtual QString pluginName() const = 0; | 31 | virtual QString pluginName() const = 0; |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Version numbering | 34 | * Version numbering |
35 | */ | 35 | */ |
36 | virtual double versionNumber() const = 0; | 36 | virtual double versionNumber() const = 0; |
37 | 37 | ||
38 | 38 | ||
39 | virtual QString pixmapNameWidget() const = 0; | 39 | virtual QString pixmapNameWidget() const = 0; |
40 | 40 | ||
41 | /** widget for the today view | 41 | /** widget for the today view |
42 | * It _needs_ a parent here. | 42 | * It _needs_ a parent here. |
43 | */ | 43 | */ |
44 | virtual QWidget* widget( QWidget * ) = 0; | 44 | virtual QWidget* widget( QWidget * ) = 0; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Pixmap used in the config widget | 47 | * Pixmap used in the config widget |
48 | */ | 48 | */ |
49 | virtual QString pixmapNameConfig() const = 0; | 49 | virtual QString pixmapNameConfig() const = 0; |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Config plugin widget - optional | 52 | * Config plugin widget - optional |
53 | * If the plugin has a config widget, it _needs_ a parent here. | 53 | * If the plugin has a config widget, it _needs_ a parent here. |
54 | */ | 54 | */ |
55 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; | 55 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * The application that should be assigned to the button (pixmap) | 58 | * The application that should be assigned to the button (pixmap) |
59 | */ | 59 | */ |
60 | virtual QString appName() const = 0; | 60 | virtual QString appName() const = 0; |
61 | 61 | ||
62 | |||
63 | /** | ||
64 | * If the plugin should take part in the periodic refresh | ||
65 | */ | ||
66 | virtual bool excludeFromRefresh() const = 0; | ||
67 | |||
62 | /** | 68 | /** |
63 | * minimum height the plugin at least should have | 69 | * minimum height the plugin at least should have |
64 | */ | 70 | */ |
65 | // virtual int minHeight() const = 0; | 71 | // virtual int minHeight() const = 0; |
66 | 72 | ||
67 | /** | 73 | /** |
68 | * maximum height that should be used before starting scrolling | 74 | * maximum height that should be used before starting scrolling |
69 | */ | 75 | */ |
70 | // virtual int maxHeight() const = 0; | 76 | // virtual int maxHeight() const = 0; |
71 | 77 | ||
72 | }; | 78 | }; |
73 | 79 | ||
74 | 80 | ||
75 | struct TodayPluginInterface : public QUnknownInterface { | 81 | struct TodayPluginInterface : public QUnknownInterface { |
76 | virtual TodayPluginObject *guiPart() = 0; | 82 | virtual TodayPluginObject *guiPart() = 0; |
77 | }; | 83 | }; |
78 | 84 | ||
79 | #endif | 85 | #endif |