summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp34
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp5
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.h1
3 files changed, 9 insertions, 31 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index 81bb8fd..7b6117e 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -26,24 +26,17 @@
26#include <qwhatsthis.h> 26#include <qwhatsthis.h>
27#include <qvgroupbox.h> 27#include <qvgroupbox.h>
28 28
29 29
30AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name) 30AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name)
31 : TodayConfigWidget(parent, name ) { 31 : TodayConfigWidget(parent, name ) {
32 32
33 QVBoxLayout * layout = new QVBoxLayout( this ); 33 QVBoxLayout * layout = new QVBoxLayout( this );
34 layout->setMargin( 20 ); 34 layout->setMargin( 5 );
35
36#if 0
37 // Informational stuff
38 QHBox *box4 = new QHBox( this );
39 QLabel* colorLabel = new QLabel( box4, "" );
40 colorLabel->setText( tr( "To activate settings: Restart application !" ) );
41#endif
42 35
43 // Buttongroup to enable/disable shown stuff 36 // Buttongroup to enable/disable shown stuff
44 QVGroupBox* b_group = new QVGroupBox( this, "name" ); 37 QVGroupBox* b_group = new QVGroupBox( this, "name" );
45 b_group -> setTitle( tr("Enable/Disable Views") ); 38 b_group -> setTitle( tr("Enable/Disable Views") );
46 m_showBirthdayButton = new QRadioButton( b_group ); 39 m_showBirthdayButton = new QRadioButton( b_group );
47 m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) ); 40 m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) );
48 m_showAnniversaryButton = new QRadioButton( b_group ); 41 m_showAnniversaryButton = new QRadioButton( b_group );
49 m_showAnniversaryButton -> setText( tr( "Show &Anniveraries" ) ); 42 m_showAnniversaryButton -> setText( tr( "Show &Anniveraries" ) );
@@ -54,39 +47,24 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
54 // Max lines settings 47 // Max lines settings
55 QHBox *box1 = new QHBox( this ); 48 QHBox *box1 = new QHBox( this );
56 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); 49 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" );
57 TextLabel6->setText( tr( "Max Lines: " ) ); 50 TextLabel6->setText( tr( "Max Lines: " ) );
58 SpinBox2 = new QSpinBox( box1, "SpinBox2" ); 51 SpinBox2 = new QSpinBox( box1, "SpinBox2" );
59 SpinBox2->setMaxValue( 40 ); 52 SpinBox2->setMaxValue( 40 );
60 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each anniversaries/birthdays" ) ); 53 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each anniversaries/birthdays" ) );
61 54
62#if 0
63 // Clip settings (currently not used)
64 QHBox *box2 = new QHBox( this );
65 QLabel* clipLabel = new QLabel( box2, "" );
66 clipLabel->setText( tr( "Clip line after X chars: " ) );
67 SpinBoxClip = new QSpinBox( box2, "SpinClip" );
68 SpinBoxClip->setMaxValue( 200 );
69 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
70#endif
71
72 // Look ahead settings 55 // Look ahead settings
73 QHBox *box3 = new QHBox( this ); 56 QHBox *box3 = new QHBox( this );
74 QLabel* daysLabel = new QLabel( box3, "" ); 57 QLabel* daysLabel = new QLabel( box3, "" );
75 daysLabel->setText( tr( "Days look ahead: " ) ); 58 daysLabel->setText( tr( "Days look ahead: " ) );
76 SpinDaysClip = new QSpinBox( box3, "SpinDays" ); 59 SpinDaysClip = new QSpinBox( box3, "SpinDays" );
77 SpinDaysClip->setMaxValue( 200 ); 60 SpinDaysClip->setMaxValue( 200 );
78 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); 61 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) );
79 62
80// QHBox *box4 = new QHBox( this );
81
82// QLabel* colorLabel = new QLabel( box4, "" );
83// colorLabel->setText( tr( "To activate settings: Restart application !" ) );
84
85 63
86 QHBox *box5 = new QHBox( this ); 64 QHBox *box5 = new QHBox( this );
87 QLabel* colorLabel2 = new QLabel( box5, "" ); 65 QLabel* colorLabel2 = new QLabel( box5, "" );
88 colorLabel2->setText( tr( "Set Headline Color: " ) ); 66 colorLabel2->setText( tr( "Set Headline Color: " ) );
89 headlineColor = new Opie::OColorButton( box5, black , "headlineColor" ); 67 headlineColor = new Opie::OColorButton( box5, black , "headlineColor" );
90 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); 68 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) );
91 QHBox *box6 = new QHBox( this ); 69 QHBox *box6 = new QHBox( this );
92 70
@@ -104,23 +82,29 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
104 SpinUrgentClip->setMaxValue( 200 ); 82 SpinUrgentClip->setMaxValue( 200 );
105 QLabel* colorLabel6 = new QLabel( box7, "" ); 83 QLabel* colorLabel6 = new QLabel( box7, "" );
106 colorLabel6->setText( tr( " days: " ) ); 84 colorLabel6->setText( tr( " days: " ) );
107 urgentColor = new Opie::OColorButton( box7, red , "urgentColor" ); 85 urgentColor = new Opie::OColorButton( box7, red , "urgentColor" );
108 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) ); 86 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) );
109 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); 87 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) );
110 88
111 89
112 //layout->addWidget( box4 ); 90 layout->addWidget( b_group );
113 layout->addWidget( box1 ); 91 layout->addWidget( box1 );
114 //layout->addWidget( box2 );
115 layout->addWidget( box3 ); 92 layout->addWidget( box3 );
116 layout->addWidget( box5 ); 93 layout->addWidget( box5 );
117 layout->addWidget( box6 ); 94 layout->addWidget( box6 );
118 layout->addWidget( box7 ); 95 layout->addWidget( box7 );
96
97 /*
98 * pack the widgets together
99 */
100 QSpacerItem *item = new QSpacerItem( 1, 2, QSizePolicy::Minimum,
101 QSizePolicy::MinimumExpanding );
102 layout->addItem( item );
119 103
120 readConfig(); 104 readConfig();
121 105
122} 106}
123 107
124void AddressBookPluginConfig::readConfig() { 108void AddressBookPluginConfig::readConfig() {
125 Config cfg( "todayaddressplugin" ); 109 Config cfg( "todayaddressplugin" );
126 cfg.setGroup( "config" ); 110 cfg.setGroup( "config" );
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index d76a29a..df7c5e1 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -25,21 +25,16 @@
25 25
26AddressBookPluginWidget::AddressBookPluginWidget( QWidget *parent, const char* name ) 26AddressBookPluginWidget::AddressBookPluginWidget( QWidget *parent, const char* name )
27 : QWidget( parent, name ) { 27 : QWidget( parent, name ) {
28 28
29 addressLabel = 0l; 29 addressLabel = 0l;
30 m_contactdb = 0l; 30 m_contactdb = 0l;
31 layoutTodo = 0l; 31 layoutTodo = 0l;
32 32
33 // Hä ? Nonsense ! (se)
34 if ( m_contactdb ) {
35 delete m_contactdb;
36 }
37
38 m_contactdb = new Opie::OPimContactAccess("addressplugin"); 33 m_contactdb = new Opie::OPimContactAccess("addressplugin");
39 34
40 connect( m_contactdb, SIGNAL( signalChanged(const Opie::OPimContactAccess*) ), 35 connect( m_contactdb, SIGNAL( signalChanged(const Opie::OPimContactAccess*) ),
41 this, SLOT( refresh(const Opie::OPimContactAccess*) ) ); 36 this, SLOT( refresh(const Opie::OPimContactAccess*) ) );
42 37
43 38
44 readConfig(); 39 readConfig();
45 getAddress(); 40 getAddress();
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.h b/core/pim/today/plugins/addressbook/addresspluginwidget.h
index b1c690d..25b3098 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.h
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.h
@@ -23,17 +23,16 @@
23#include <opie2/oclickablelabel.h> 23#include <opie2/oclickablelabel.h>
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qlayout.h> 27#include <qlayout.h>
28 28
29 29
30class AddressBookPluginWidget : public QWidget { 30class AddressBookPluginWidget : public QWidget {
31
32 Q_OBJECT 31 Q_OBJECT
33 32
34public: 33public:
35 AddressBookPluginWidget( QWidget *parent, const char *name ); 34 AddressBookPluginWidget( QWidget *parent, const char *name );
36 ~AddressBookPluginWidget(); 35 ~AddressBookPluginWidget();
37 36
38 void reinitialize(); 37 void reinitialize();
39public slots: 38public slots: