summaryrefslogtreecommitdiff
path: root/core/pim/today/todayconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/today/todayconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/todayconfig.cpp15
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
@@ -9,125 +9,122 @@
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "todayconfig.h" 17#include "todayconfig.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/resource.h> 20#include <qpe/resource.h>
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
36class ToolButton : public QToolButton { 33class ToolButton : public QToolButton {
34
37public: 35public:
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 */
55TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl ) 53TodayConfig::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();
78 QVBox *vbox1 = new QVBox( hbox1 ); 74 QVBox *vbox1 = new QVBox( hbox1 );
79 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", this , SLOT( moveSelectedUp() ) ); 75 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", this , SLOT( moveSelectedUp() ) );
80 new ToolButton( vbox1, tr( "Move Down" ),"opieplayer/down", this , SLOT( moveSelectedDown() ) ); 76 new ToolButton( vbox1, tr( "Move Down" ),"opieplayer/down", this , SLOT( moveSelectedDown() ) );
81 tab2Layout->addWidget( hbox1 ); 77 tab2Layout->addWidget( hbox1 );
82 78
83 TabWidget3->insertTab( tab_2, tr( "active/order" ) ); 79 TabWidget3->insertTab( tab_2, tr( "active/order" ) );
84 tab_3 = new QWidget( TabWidget3, "tab_3" ); 80 tab_3 = new QWidget( TabWidget3, "tab_3" );
85 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 81 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
86 QHBox *hbox_clip = new QHBox( tab_3 ); 82 QHBox *hbox_clip = new QHBox( tab_3 );
87 TextLabel1 = new QLabel( hbox_clip, "TextLabel1" ); 83 TextLabel1 = new QLabel( hbox_clip, "TextLabel1" );
88 TextLabel1->setText( tr( "Clip after how\n" 84 TextLabel1->setText( tr( "Clip after how\n"
89 "many letters" ) ); 85 "many letters" ) );
90 SpinBox7 = new QSpinBox( hbox_clip, "SpinBox7" ); 86 SpinBox7 = new QSpinBox( hbox_clip, "SpinBox7" );
91 SpinBox7->setMaxValue( 80 ); 87 SpinBox7->setMaxValue( 80 );
92 QHBox *hbox_auto = new QHBox( tab_3 ); 88 QHBox *hbox_auto = new QHBox( tab_3 );
93 TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); 89 TextLabel2 = new QLabel( hbox_auto, "AutoStart" );
94 TextLabel2->setText( tr( "autostart on \nresume? (Opie only)" ) ); 90 TextLabel2->setText( tr( "autostart on \nresume? (Opie only)" ) );
95 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); 91 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" );
96 QHBox *hbox_inactive = new QHBox( tab_3 ); 92 QHBox *hbox_inactive = new QHBox( tab_3 );
97 TimeLabel = new QLabel( hbox_inactive , "TimeLabel" ); 93 TimeLabel = new QLabel( hbox_inactive , "TimeLabel" );
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 */
117void TodayConfig::setAutoStart() { 114void 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 ) {
122 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); 119 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
123 e << QString( "add" ); 120 e << QString( "add" );
124 e << QString( "today" ); 121 e << QString( "today" );
125 e << m_autoStartTimer; 122 e << m_autoStartTimer;
126 } else { 123 } else {
127 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 124 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
128 e << QString( "remove"); 125 e << QString( "remove");
129 e << QString( "today" ); 126 e << QString( "today" );
130 } 127 }
131} 128}
132 129
133/** 130/**