[Korganizer-devel] [Bug 35700] Select a month instead of a date range when printing the month view
Reinhold Kainhofer
reinhold at kainhofer.com
Tue Jan 2 01:12:48 CET 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=35700
reinhold kainhofer com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From reinhold kainhofer com 2007-01-02 01:12 -------
SVN commit 618661 by kainhofe:
Instead of using a date selector to select a month (where the day is completely ignored and thus only confusing), now use a month name combo and a year number spin box for both the start and end month of the printout.
BUG:35700
M +21 -7 calprintdefaultplugins.cpp
M +72 -53 calprintmonthconfig_base.ui
--- branches/KDE/3.5/kdepim/korganizer/printing/calprintdefaultplugins.cpp #618660:618661
@ -35,6 +35,8 @
#include <kdebug.h>
#include <kconfig.h>
#include <kcalendarsystem.h>
+#include <knuminput.h>
+#include <kcombobox.h>
#include "calprintdefaultplugins.h"
@ -820,8 +822,8 @
CalPrintMonthConfig_Base *cfg =
dynamic_cast<CalPrintMonthConfig_Base *>( mConfigWidget );
if ( cfg ) {
- mFromDate = cfg->mFromDate->date();
- mToDate = cfg->mToDate->date();
+ mFromDate = QDate( cfg->mFromYear->value(), cfg->mFromMonth->currentItem()+1, 1 );
+ mToDate = QDate( cfg->mToYear->value(), cfg->mToMonth->currentItem()+1, 1 );
mWeekNumbers = cfg->mWeekNumbers->isChecked();
mRecurDaily = cfg->mRecurDaily->isChecked();
@ -835,10 +837,8 @
{
CalPrintMonthConfig_Base *cfg =
dynamic_cast<CalPrintMonthConfig_Base *>( mConfigWidget );
+ setDateRange( mFromDate, mToDate );
if ( cfg ) {
- cfg->mFromDate->setDate( mFromDate );
- cfg->mToDate->setDate( mToDate );
-
cfg->mWeekNumbers->setChecked( mWeekNumbers );
cfg->mRecurDaily->setChecked( mRecurDaily );
cfg->mRecurWeekly->setChecked( mRecurWeekly );
@ -874,9 +874,23 @
CalPrintPluginBase::setDateRange( from, to );
CalPrintMonthConfig_Base *cfg =
dynamic_cast<CalPrintMonthConfig_Base *>( mConfigWidget );
+ const KCalendarSystem *calSys = calendarSystem();
+ if ( cfg && calSys ) {
+ cfg->mFromMonth->clear();
+ for ( int i=0; i<calSys->monthsInYear( mFromDate ); ++i ) {
+ cfg->mFromMonth->insertItem( calSys->monthName( i+1, mFromDate.year() ) );
+ }
+ cfg->mToMonth->clear();
+ for ( int i=0; i<calSys->monthsInYear( mToDate ); ++i ) {
+ cfg->mToMonth->insertItem( calSys->monthName( i+1, mToDate.year() ) );
+ }
+ }
+kdDebug()<<"vor SetSettingsWidget()"<<endl;
if ( cfg ) {
- cfg->mFromDate->setDate( from );
- cfg->mToDate->setDate( to );
+ cfg->mFromMonth->setCurrentItem( from.month()-1 );
+ cfg->mFromYear->setValue( to.year() );
+ cfg->mToMonth->setCurrentItem( mToDate.month()-1 );
+ cfg->mToYear->setValue( mToDate.year() );
}
}
--- branches/KDE/3.5/kdepim/korganizer/printing/calprintmonthconfig_base.ui #618660:618661
@ -10,10 +10,13 @
<rect>
<x>0</x>
<y>0</y>
- <width>401</width>
- <height>173</height>
+ <width>431</width>
+ <height>161</height>
</rect>
</property>
+ <property name="caption">
+ <string>CalPrintMonth_Base</string>
+ </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
@ -45,90 +48,104 @
<property name="title">
<string>Date && Time Range</string>
</property>
- <grid>
+ <hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <spacer row="0" column="4">
+ <widget class="QLabel">
<property name="name">
- <cstring>spacer1</cstring>
+ <cstring>mFromDateLabel</cstring>
</property>
- <property name="orientation">
- <enum>Horizontal</enum>
+ <property name="text">
+ <string>&Start month:</string>
</property>
- <property name="sizeType">
- <enum>Expanding</enum>
+ <property name="buddy" stdset="0">
+ <cstring>mFromMonth</cstring>
</property>
- <property name="sizeHint">
- <size>
- <width>17</width>
- <height>21</height>
- </size>
+ <property name="whatsThis" stdset="0">
+ <string>When you want to print more months at once, you can define a month range. This option defines the first month to be printed. Use the option <i>End month</i> to define the last month in this range.</string>
</property>
- </spacer>
- <widget class="QLabel" row="0" column="2">
+ </widget>
+ <widget class="KComboBox">
<property name="name">
+ <cstring>mFromMonth</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When you want to print more months at once, you can define a month range. This option defines the fi
+rst month to be printed. Use the option &lt;i&gt;End month&lt;/i&gt; to define the last month in this range.</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>mFromYear</cstring>
+ </property>
+ <property name="maxValue">
+ <number>3000</number>
+ </property>
+ <property name="value">
+ <number>2007</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When you want to print more months at once, you can define a month range. This option defines the fi
+rst month to be printed. Use the option &lt;i&gt;End month&lt;/i&gt; to define the last month in this range.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
<cstring>mToDateLabel</cstring>
</property>
<property name="text">
<string>&End month:</string>
</property>
<property name="buddy" stdset="0">
- <cstring>mToDate</cstring>
+ <cstring>mToMonth</cstring>
</property>
<property name="whatsThis" stdset="0">
<string>When you want to print more months at once, you can define a month range. This option defines the last month to be printed. Use the option <i>Start month</i> to define the first month in this range.</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="KComboBox">
<property name="name">
- <cstring>mFromDateLabel</cstring>
+ <cstring>mToMonth</cstring>
</property>
- <property name="text">
- <string>&Start month:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>mFromDate</cstring>
- </property>
<property name="whatsThis" stdset="0">
- <string>When you want to print more months at once, you can define a month range. This option defines the first month to be printed. Use the option <i>End month</i> to define the last month in this range.</string>
+ <string>When you want to print more months at once, you can define a month range. This option defines the la
+st month to be printed. Use the option &lt;i&gt;Start month&lt;/i&gt; to define the first month in this range.</string>
</property>
</widget>
- <widget class="KDateEdit" row="0" column="3">
+ <widget class="KIntSpinBox">
<property name="name">
- <cstring>mToDate</cstring>
+ <cstring>mToYear</cstring>
</property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
+ <property name="maxValue">
+ <number>3000</number>
</property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
+ <property name="value">
+ <number>2007</number>
</property>
<property name="whatsThis" stdset="0">
- <string>When you want to print more months at once, you can define a month range. This option defines the last month to be printed. Use the option <i>Start month</i> to define the first month in this range.</string>
+ <string>When you want to print more months at once, you can define a month range. This option defines the la
+st month to be printed. Use the option &lt;i&gt;Start month&lt;/i&gt; to define the first month in this range.</string>
</property>
</widget>
- <widget class="KDateEdit" row="0" column="1">
+ <spacer>
<property name="name">
- <cstring>mFromDate</cstring>
+ <cstring>spacer1</cstring>
</property>
- <property name="minimumSize">
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
<size>
- <width>50</width>
- <height>0</height>
+ <width>17</width>
+ <height>21</height>
</size>
</property>
- <property name="focusPolicy">
- <enum>StrongFocus</enum>
- </property>
- <property name="whatsThis" stdset="0">
- <string>When you want to print more months at once, you can define a month range. This option defines the first month to be printed.</string>
- </property>
- </widget>
- </grid>
+ </spacer>
+ </hbox>
</widget>
<widget class="QCheckBox" row="4" column="0">
<property name="name">
@ -179,9 +196,9 @
</widget>
</grid>
</widget>
+<customwidgets>
+</customwidgets>
<tabstops>
- <tabstop>mFromDate</tabstop>
- <tabstop>mToDate</tabstop>
<tabstop>mWeekNumbers</tabstop>
<tabstop>mRecurDaily</tabstop>
<tabstop>mRecurWeekly</tabstop>
@ -192,7 +209,9 @
</includes>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
- <includehint>libkdepim/kdateedit.h</includehint>
- <includehint>libkdepim/kdateedit.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>knuminput.h</includehint>
</includehints>
</UI>
More information about the Korganizer-devel
mailing list