Diffstat (limited to 'core/pim/today/todayconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/todayconfig.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 08e59c0..79c4d1f 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -21,57 +21,53 @@ | |||
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | 22 | ||
23 | #include <qcheckbox.h> | 23 | #include <qcheckbox.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qspinbox.h> | 25 | #include <qspinbox.h> |
26 | #include <qtabwidget.h> | 26 | #include <qtabwidget.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qheader.h> | 28 | #include <qheader.h> |
29 | #include <qhbox.h> | 29 | #include <qhbox.h> |
30 | #include <qvbox.h> | 30 | #include <qvbox.h> |
31 | #include <qtoolbutton.h> | 31 | #include <qtoolbutton.h> |
32 | 32 | ||
33 | // for getenv | ||
34 | #include <stdlib.h> | ||
35 | |||
36 | class ToolButton : public QToolButton { | 33 | class ToolButton : public QToolButton { |
34 | |||
37 | public: | 35 | public: |
38 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 36 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
39 | : QToolButton( parent, name ) { | 37 | : QToolButton( parent, name ) { |
40 | setTextLabel( name ); | 38 | // setTextLabel( name ); |
41 | setPixmap( Resource::loadPixmap( icon ) ); | 39 | setPixmap( Resource::loadPixmap( icon ) ); |
42 | setAutoRaise( TRUE ); | 40 | setAutoRaise( TRUE ); |
43 | setFocusPolicy( QWidget::NoFocus ); | 41 | setFocusPolicy( QWidget::NoFocus ); |
44 | setToggleButton( t ); | 42 | setToggleButton( t ); |
45 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 43 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
46 | } | 44 | } |
47 | }; | 45 | }; |
48 | 46 | ||
49 | 47 | ||
50 | /** | 48 | /** |
51 | * The class has currently quite some duplicate code. | 49 | * The class has currently quite some duplicate code. |
52 | * By that way it would be real easy to have it as seperate app in settings tab | 50 | * By that way it would be real easy to have it as seperate app in settings tab |
53 | * | 51 | * |
54 | */ | 52 | */ |
55 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl ) | 53 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl ) |
56 | : QDialog( parent, name, modal, fl ) { | 54 | : QDialog( parent, name, modal, fl ) { |
57 | 55 | ||
58 | if ( !name ) { | ||
59 | setName( "todayconfig" ); | ||
60 | } | ||
61 | setCaption( tr( "Today config" ) ); | 56 | setCaption( tr( "Today config" ) ); |
62 | 57 | ||
63 | QVBoxLayout *layout = new QVBoxLayout( this ); | 58 | QVBoxLayout *layout = new QVBoxLayout( this ); |
64 | TabWidget3 = new QTabWidget( this, "TabWidget3" ); | 59 | TabWidget3 = new QTabWidget( this, "TabWidget3" ); |
65 | TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); | 60 | // TabWidget3->setFrameShape( QFrame::NoFrame ); |
61 | //TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); | ||
66 | TabWidget3->setAutoMask( FALSE ); | 62 | TabWidget3->setAutoMask( FALSE ); |
67 | TabWidget3->setTabShape( QTabWidget::Rounded ); | 63 | TabWidget3->setTabShape( QTabWidget::Rounded ); |
68 | layout->addWidget( TabWidget3 ); | 64 | layout->addWidget( TabWidget3 ); |
69 | 65 | ||
70 | tab_2 = new QWidget( TabWidget3, "tab_2" ); | 66 | tab_2 = new QWidget( TabWidget3, "tab_2" ); |
71 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); | 67 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); |
72 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); | 68 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); |
73 | tab2Layout->addWidget( l ); | 69 | tab2Layout->addWidget( l ); |
74 | QHBox *hbox1 = new QHBox( tab_2 ); | 70 | QHBox *hbox1 = new QHBox( tab_2 ); |
75 | m_appletListView = new QListView( hbox1 ); | 71 | m_appletListView = new QListView( hbox1 ); |
76 | m_appletListView->addColumn( "PluginList" ); | 72 | m_appletListView->addColumn( "PluginList" ); |
77 | m_appletListView->header()->hide(); | 73 | m_appletListView->header()->hide(); |
@@ -98,24 +94,25 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags | |||
98 | TimeLabel->setText( tr( "minutes inactive" ) ); | 94 | TimeLabel->setText( tr( "minutes inactive" ) ); |
99 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner"); | 95 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner"); |
100 | tab3Layout->addWidget( hbox_clip ); | 96 | tab3Layout->addWidget( hbox_clip ); |
101 | tab3Layout->addWidget( hbox_auto ); | 97 | tab3Layout->addWidget( hbox_auto ); |
102 | tab3Layout->addWidget( hbox_inactive ); | 98 | tab3Layout->addWidget( hbox_inactive ); |
103 | TabWidget3->insertTab( tab_3, tr( "Misc" ) ); | 99 | TabWidget3->insertTab( tab_3, tr( "Misc" ) ); |
104 | 100 | ||
105 | m_applets_changed = false; | 101 | m_applets_changed = false; |
106 | 102 | ||
107 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); | 103 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); |
108 | 104 | ||
109 | readConfig(); | 105 | readConfig(); |
106 | showMaximized(); | ||
110 | } | 107 | } |
111 | 108 | ||
112 | 109 | ||
113 | /** | 110 | /** |
114 | * Autostart, uses the new (opie only) autostart method in the launcher code. | 111 | * Autostart, uses the new (opie only) autostart method in the launcher code. |
115 | * If registered against that today ist started on each resume. | 112 | * If registered against that today ist started on each resume. |
116 | */ | 113 | */ |
117 | void TodayConfig::setAutoStart() { | 114 | void TodayConfig::setAutoStart() { |
118 | Config cfg( "today" ); | 115 | Config cfg( "today" ); |
119 | cfg.setGroup( "Autostart" ); | 116 | cfg.setGroup( "Autostart" ); |
120 | int autostart = cfg.readNumEntry( "autostart", 1); | 117 | int autostart = cfg.readNumEntry( "autostart", 1); |
121 | if ( autostart ) { | 118 | if ( autostart ) { |