author | zecke <zecke> | 2003-02-11 19:12:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-11 19:12:34 (UTC) |
commit | 17738622fd2b61138695441df860f8ecd16f286f (patch) (side-by-side diff) | |
tree | 11b6282188661c21d66fef3fb0397437842112a7 | |
parent | 5145521f5ff79d6a418244e33d357b5b8168e072 (diff) | |
download | opie-17738622fd2b61138695441df860f8ecd16f286f.zip opie-17738622fd2b61138695441df860f8ecd16f286f.tar.gz opie-17738622fd2b61138695441df860f8ecd16f286f.tar.bz2 |
fix 0000535.
What is the right size? That depends on the user so save
the columWidth() the user used so he should be happy
-rw-r--r-- | core/pim/todo/tableview.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index cec8b5e..ae27fab 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp @@ -46,24 +46,28 @@ using namespace Todo; namespace { static const int BoxSize = 14; static const int RowHeight = 20; } void TableView::initConfig() { Config config( "todo" ); config.setGroup( "Options" ); m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); + for (int i = 0; i < numCols(); i++ ) { + int width = config.readNumEntry("Width"+QString::number(i), -1 ); + setColumnWidth(i, width == -1 ? columnWidth(i) : width ); + } } TableView::TableView( MainWindow* window, QWidget* wid ) : QTable( wid ), TodoView( window ) { // Load icons // TODO - probably should be done globally somewhere else, // see also quickeditimpl.cpp/h, taskeditoroverview.cpp/h m_pic_completed = Resource::loadPixmap( "todo/completed" ); QString namestr; for ( unsigned int i = 1; i < 6; i++ ) { namestr = "todo/priority"; @@ -94,44 +98,50 @@ TableView::TableView( MainWindow* window, QWidget* wid ) this, SLOT( slotClicked(int, int, int, const QPoint& ) ) ); connect((QTable*)this, SIGNAL( pressed( int, int, int, const QPoint& ) ), this, SLOT( slotPressed(int, int, int, const QPoint& ) ) ); connect((QTable*)this, SIGNAL(valueChanged(int, int) ), this, SLOT( slotValueChanged(int, int) ) ); connect((QTable*)this, SIGNAL(currentChanged(int, int) ), this, SLOT( slotCurrentChanged(int, int) ) ); m_menuTimer = new QTimer( this ); connect( m_menuTimer, SIGNAL(timeout()), this, SLOT(slotShowMenu()) ); + /* now let's init the config */ + initConfig(); + + m_enablePaint = true; setUpdatesEnabled( true ); viewport()->setUpdatesEnabled( true ); viewport()->update(); setSortOrder( 0 ); setAscending( TRUE ); m_first = true; - /* now let's init the config */ - initConfig(); + } /* a new day has started * update the day */ void TableView::newDay() { clear(); updateView(); } TableView::~TableView() { - + Config config( "todo" ); + config.setGroup( "Options" ); + for (int i = 0; i < numCols(); i++ ) + config.writeEntry("Width"+QString::number(i), columnWidth(i) ); } void TableView::slotShowMenu() { QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() ); menu->exec(QCursor::pos() ); delete menu; } QString TableView::type() const { return QString::fromLatin1( tr("Table View") ); } int TableView::current() { int uid = sorted().uidAt(currentRow() ); |