author | skyhusker <skyhusker> | 2005-04-10 12:45:59 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-04-10 12:45:59 (UTC) |
commit | 7a49d0610ae9bc1cadacf9d572c671009cb3c088 (patch) (side-by-side diff) | |
tree | 31d98c05af90dc9a3dce9eb01a5af51778ec64fc | |
parent | 713db174943e9184bfa68fa430123c52ad3c3b2b (diff) | |
download | opie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.zip opie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.tar.gz opie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.tar.bz2 |
Added configuration option for max characters displayed in notes. Fixes bug 1635
5 files changed, 54 insertions, 11 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp index 5fd5221..6b7c3ce 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp @@ -43,16 +43,18 @@ void DatebookPluginConfig::readConfig() { m_gui->CheckBox1->setChecked( m_show_location ); m_show_notes = cfg.readNumEntry( "shownotes", 0 ); m_gui->CheckBox2->setChecked( m_show_notes ); m_only_later = cfg.readNumEntry( "onlylater", 1 ); m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) ); m_gui->CheckBox3->setChecked( m_only_later ); m_more_days = cfg.readNumEntry( "moredays", 0 ); m_gui->SpinBox2->setValue( m_more_days ); + m_maxCharClip = cfg.readNumEntry( "maxcharclip" , 38 ); + m_gui->SpinBox3->setValue( m_maxCharClip ); } void DatebookPluginConfig::writeConfig() { Config cfg( "todaydatebookplugin" ); cfg.setGroup( "config" ); m_max_lines_meet = m_gui->SpinBox1->value(); @@ -61,13 +63,15 @@ void DatebookPluginConfig::writeConfig() { cfg.writeEntry( "showlocation", m_show_location); m_show_notes = m_gui->CheckBox2->isChecked(); cfg.writeEntry( "shownotes", m_show_notes ); m_only_later = m_gui->CheckBox3->isChecked(); cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() ); cfg.writeEntry( "onlylater", m_only_later ); m_more_days = m_gui->SpinBox2->value(); cfg.writeEntry( "moredays", m_more_days ); + m_maxCharClip = m_gui->SpinBox3->value(); + cfg.writeEntry( "maxcharclip", m_maxCharClip ); cfg.write(); } DatebookPluginConfig::~DatebookPluginConfig() { } diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index 4f4e3f1..61e31e0 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h @@ -51,13 +51,14 @@ private: int m_max_lines_meet; // If location is to be showed too, 1 to activate it. int m_show_location; // if notes should be shown int m_show_notes; // should only later appointments be shown or all for the current day. int m_only_later; int m_more_days; + int m_maxCharClip; }; #endif diff --git a/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui b/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui index 943e8ec..004204a 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui +++ b/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui @@ -6,94 +6,94 @@ <name>name</name> <cstring>DatebookPluginConfigBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>228</width> + <width>224</width> <height>267</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>DatebookPluginConfigBase</string> </property> <property> <name>whatsThis</name> <string></string> </property> - <vbox> + <grid> <property stdset="1"> <name>margin</name> <number>11</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> - <widget> + <widget row="0" column="0" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>CheckBox1</cstring> </property> <property stdset="1"> <name>text</name> <string>Show location</string> </property> <property> <name>whatsThis</name> <string>Check this if the location of an appointment should be shown for each one</string> </property> </widget> - <widget> + <widget row="1" column="0" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>CheckBox2</cstring> </property> <property stdset="1"> <name>text</name> <string>Show notes</string> </property> <property> <name>whatsThis</name> <string>Check this if the note attached to an appointment should be shown for each one</string> </property> </widget> - <widget> + <widget row="2" column="0" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>CheckBox3</cstring> </property> <property stdset="1"> <name>text</name> <string>Show only later appointments</string> </property> <property> <name>whatsThis</name> <string>Check this if only appointments later then current time should be shown</string> </property> </widget> - <widget> + <widget row="3" column="0" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>CheckBox4</cstring> </property> <property stdset="1"> <name>text</name> <string>Show time in extra line</string> </property> </widget> - <widget> + <widget row="4" column="0" > <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout3</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> @@ -133,17 +133,17 @@ <set>WordBreak|AlignVCenter|AlignLeft</set> </property> <property> <name>wordwrap</name> </property> </widget> </hbox> </widget> - <widget> + <widget row="5" column="0" > <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout2</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> @@ -187,17 +187,52 @@ <set>WordBreak|AlignVCenter|AlignLeft</set> </property> <property> <name>wordwrap</name> </property> </widget> </hbox> </widget> - <spacer> + <widget row="6" column="0" > + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout6</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QSpinBox</class> + <property stdset="1"> + <name>name</name> + <cstring>SpinBox3</cstring> + </property> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1_2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Clip line after X chars</string> + </property> + </widget> + </hbox> + </widget> + <spacer row="7" column="0" > <property> <name>name</name> <cstring>Spacer2</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> </property> @@ -208,11 +243,11 @@ <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - </vbox> + </grid> </widget> </UI> diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index 0820802..eb6d47a 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -49,16 +49,17 @@ void DatebookPluginWidget::readConfig() { Config cfg( "todaydatebookplugin" ); cfg.setGroup( "config" ); m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); m_show_location = cfg.readNumEntry( "showlocation", 1 ); m_show_notes = cfg.readNumEntry( "shownotes", 0 ); m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); m_moreDays = cfg.readNumEntry( "moredays", 0 ); m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 ); + m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); } void DatebookPluginWidget::reinitialize() { readConfig(); refresh(); } void DatebookPluginWidget::refresh() { @@ -91,17 +92,17 @@ void DatebookPluginWidget::getDates() { if ( list.count() > 0 ) { for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) { if ( count < m_max_lines_meet ) { if ( !m_onlyLater ) { count++; - DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); + DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine, m_maxCharClip ); m_eventsList.append( l ); l->show(); QObject::connect ( l, SIGNAL( editEvent(const Event&) ), l, SLOT( editEventSlot(const Event&) ) ); } else { if ( ( QDateTime::currentDateTime() <= (*it).event().end() ) // Show events which span over many days and are not elapsed. || ( ( (*it).event().start().date() != date ) && ( QDateTime::currentDateTime() <= (*it).event().end() ) ) // Show repeated event for today that is not elapsed. diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.h b/core/pim/today/plugins/datebook/datebookpluginwidget.h index f8ed89e..65e060e 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.h +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.h @@ -52,11 +52,13 @@ private: bool m_show_location; // if notes should be shown bool m_show_notes; // should only later appointments be shown or all for the current day. bool m_onlyLater; int m_moreDays; // true if time of an appointment should be an extra line bool m_timeExtraLine; + //max characters displayed in notes + int m_maxCharClip; }; #endif |