summaryrefslogtreecommitdiff
path: root/libopie
Unidiff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofileselectormain.cpp41
-rw-r--r--libopie/ofileselector/ofileselectormain.h23
2 files changed, 64 insertions, 0 deletions
diff --git a/libopie/ofileselector/ofileselectormain.cpp b/libopie/ofileselector/ofileselectormain.cpp
new file mode 100644
index 0000000..dd3b08c
--- a/dev/null
+++ b/libopie/ofileselector/ofileselectormain.cpp
@@ -0,0 +1,41 @@
1#include <qwidgetstack.h>
2#include <qlayout.h>
3
4#include "ofileselectormain.h"
5
6OFileSelectorMain::OFileSelectorMain( QWidget* parent )
7 : QWidget( parent ), m_tool(0)
8{
9 m_lay = 0;
10 init();
11}
12OFileSelectorMain::~OFileSelectorMain() {
13
14}
15void OFileSelectorMain::setToolbar( QWidget* tool ) {
16 delete m_tool;
17 m_tool = tool;
18 add();
19}
20void OFileSelectorMain::setWidget( QWidget* wid ) {
21 static int i = 0;
22 m_stack->addWidget( wid, i );
23 m_stack->raiseWidget( i );
24 i++;
25}
26void OFileSelectorMain::add() {
27 qWarning("adding items ");
28 if (m_tool )
29 m_lay->addWidget( m_tool, 0, 0 );
30
31}
32void OFileSelectorMain::init() {
33 delete m_lay;
34
35 m_lay = new QGridLayout( this, 2, 1 );
36 m_lay->setRowStretch( 0, 1 );
37 m_lay->setRowStretch( 1, 500 );
38
39 m_stack = new QWidgetStack( this );
40 m_lay->addWidget( m_stack, 1, 0 );
41}
diff --git a/libopie/ofileselector/ofileselectormain.h b/libopie/ofileselector/ofileselectormain.h
new file mode 100644
index 0000000..b540b9a
--- a/dev/null
+++ b/libopie/ofileselector/ofileselectormain.h
@@ -0,0 +1,23 @@
1#ifndef OPIE_FILESELECTOR_MAIN_H
2#define OPIE_FILESELECTOR_MAIN_H
3
4#include <qwidget.h>
5
6class QGridLayout;
7class QWidgetStack;
8class OFileSelectorMain : public QWidget {
9 Q_OBJECT
10public:
11 OFileSelectorMain( QWidget* parent );
12 ~OFileSelectorMain();
13 void setToolbar( QWidget* tool );
14 void setWidget( QWidget* view );
15private:
16 void init();
17 void add();
18 QGridLayout *m_lay;
19 QWidget* m_tool;
20 QWidgetStack *m_stack;
21};
22
23#endif