summaryrefslogtreecommitdiff
authordrw <drw>2005-06-03 18:31:12 (UTC)
committer drw <drw>2005-06-03 18:31:12 (UTC)
commit77736831bd44d6ca60ee573133cd72551d312dbc (patch) (unidiff)
tree7bd56feaf8283e813d2064e7bef1177666897b5d
parentd0f6a0721d7ab67a115d08990143944ee71d54ba (diff)
downloadopie-77736831bd44d6ca60ee573133cd72551d312dbc.zip
opie-77736831bd44d6ca60ee573133cd72551d312dbc.tar.gz
opie-77736831bd44d6ca60ee573133cd72551d312dbc.tar.bz2
Add config option to use smaller font for checkbook transaction tab - patch courtesy of hrw
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/cfg.cpp3
-rw-r--r--noncore/apps/checkbook/cfg.h45
-rw-r--r--noncore/apps/checkbook/checkbook.cpp5
-rw-r--r--noncore/apps/checkbook/configuration.cpp6
-rw-r--r--noncore/apps/checkbook/configuration.h1
5 files changed, 38 insertions, 22 deletions
diff --git a/noncore/apps/checkbook/cfg.cpp b/noncore/apps/checkbook/cfg.cpp
index 24fa4cb..4f70593 100644
--- a/noncore/apps/checkbook/cfg.cpp
+++ b/noncore/apps/checkbook/cfg.cpp
@@ -34,12 +34,13 @@
34#include "cfg.h" 34#include "cfg.h"
35 35
36// --- Cfg -------------------------------------------------------------------- 36// --- Cfg --------------------------------------------------------------------
37Cfg::Cfg() 37Cfg::Cfg()
38{ 38{
39 _currencySymbol="$"; 39 _currencySymbol="$";
40 _useSmallFont=TRUE;
40 _showLocks=FALSE; 41 _showLocks=FALSE;
41 _showBalances=FALSE; 42 _showBalances=FALSE;
42 _pCategories=new CategoryList(); 43 _pCategories=new CategoryList();
43 _bDirty=false; 44 _bDirty=false;
44} 45}
45 46
@@ -74,12 +75,13 @@ void Cfg::readConfig(Config &config)
74{ 75{
75 // set group 76 // set group
76 config.setGroup( "Config" ); 77 config.setGroup( "Config" );
77 78
78 // read scalars 79 // read scalars
79 _currencySymbol = config.readEntry( "CurrencySymbol", "$" ); 80 _currencySymbol = config.readEntry( "CurrencySymbol", "$" );
81 _useSmallFont = config.readBoolEntry( "UseSmallFont", TRUE );
80 _showLocks = config.readBoolEntry( "ShowLocks", FALSE ); 82 _showLocks = config.readBoolEntry( "ShowLocks", FALSE );
81 _showBalances = config.readBoolEntry( "ShowBalances", FALSE ); 83 _showBalances = config.readBoolEntry( "ShowBalances", FALSE );
82 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE ); 84 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE );
83 _sLastBook = config.readEntry("LastBook", ""); 85 _sLastBook = config.readEntry("LastBook", "");
84 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE ); 86 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE );
85 _bSavePayees = config.readBoolEntry( "SavePayees", FALSE ); 87 _bSavePayees = config.readBoolEntry( "SavePayees", FALSE );
@@ -161,12 +163,13 @@ void Cfg::writeConfig(Config &config)
161{ 163{
162 // set the group 164 // set the group
163 config.setGroup( "Config" ); 165 config.setGroup( "Config" );
164 166
165 // write scalars 167 // write scalars
166 config.writeEntry( "CurrencySymbol", _currencySymbol ); 168 config.writeEntry( "CurrencySymbol", _currencySymbol );
169 config.writeEntry( "UseSmallFont", _useSmallFont );
167 config.writeEntry( "ShowLocks", _showLocks ); 170 config.writeEntry( "ShowLocks", _showLocks );
168 config.writeEntry( "ShowBalances", _showBalances ); 171 config.writeEntry( "ShowBalances", _showBalances );
169 config.writeEntry( "OpenLastBook", _openLastBook ); 172 config.writeEntry( "OpenLastBook", _openLastBook );
170 config.writeEntry( "LastBook", _sLastBook ); 173 config.writeEntry( "LastBook", _sLastBook );
171 config.writeEntry( "ShowLastTab", _showLastTab ); 174 config.writeEntry( "ShowLastTab", _showLastTab );
172 config.writeEntry( "SavePayees", _bSavePayees ); 175 config.writeEntry( "SavePayees", _bSavePayees );
diff --git a/noncore/apps/checkbook/cfg.h b/noncore/apps/checkbook/cfg.h
index 20692b4..418bd93 100644
--- a/noncore/apps/checkbook/cfg.h
+++ b/noncore/apps/checkbook/cfg.h
@@ -1,29 +1,29 @@
1/* 1/*
2                This file is part of the OPIE Project 2 This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4 .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5 .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6_;:, .> :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_, > . <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.-- : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i, .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10- . .-<_> .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11 ._= =} : or (at your option) any later version.
12    .%`+i>       _;_. 12 .%`+i> _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13 .i_,=:_. -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15 : .. .:, . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.= = ; Public License for more details.
19++=   -.     .`     .: 19++= -. .` .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20: = ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21-. .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22 -_. . . )=. = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23 -- :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef CFG_H 29#ifndef CFG_H
@@ -65,12 +65,14 @@ class Cfg
65{ 65{
66 public: 66 public:
67 // --- Constructor 67 // --- Constructor
68 Cfg(); 68 Cfg();
69 69
70 // --- members 70 // --- members
71 bool getUseSmallFont() { return(_useSmallFont); }
72 void setUseSmallFont(bool n) { _useSmallFont=n; }
71 bool getShowLocks() { return(_showLocks); } 73 bool getShowLocks() { return(_showLocks); }
72 void setShowLocks(bool n) { _showLocks=n; } 74 void setShowLocks(bool n) { _showLocks=n; }
73 bool getShowBalances() { return(_showBalances); } 75 bool getShowBalances() { return(_showBalances); }
74 void setShowBalances(bool n) { _showBalances=n; } 76 void setShowBalances(bool n) { _showBalances=n; }
75 QString &getCurrencySymbol() { return(_currencySymbol); } 77 QString &getCurrencySymbol() { return(_currencySymbol); }
76 void setCurrencySymbol(QString n) {_currencySymbol= n; } 78 void setCurrencySymbol(QString n) {_currencySymbol= n; }
@@ -113,12 +115,13 @@ class Cfg
113 115
114 // --- writes list in configuration file 116 // --- writes list in configuration file
115 static void writeStringList(Config &cfg, const char *sKey, QStringList &lst); 117 static void writeStringList(Config &cfg, const char *sKey, QStringList &lst);
116 118
117 private: 119 private:
118 QString _currencySymbol; 120 QString _currencySymbol;
121 bool _useSmallFont;
119 bool _showLocks; 122 bool _showLocks;
120 bool _showBalances; 123 bool _showBalances;
121 bool _openLastBook; 124 bool _openLastBook;
122 bool _showLastTab; 125 bool _showLastTab;
123 bool _bDirty; 126 bool _bDirty;
124 bool _bSavePayees; 127 bool _bSavePayees;
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index b325f45..1231f42 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -218,13 +218,16 @@ QWidget *Checkbook::initTransactions()
218 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); 218 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 );
219 connect( _cbSortType, SIGNAL( activated(const QString&) ), this, SLOT( slotSortChanged(const QString&) ) ); 219 connect( _cbSortType, SIGNAL( activated(const QString&) ), this, SLOT( slotSortChanged(const QString&) ) );
220 220
221 // Table 221 // Table
222 tranTable = new QListView( control ); 222 tranTable = new QListView( control );
223 QFont fnt(QPEApplication::font()); 223 QFont fnt(QPEApplication::font());
224 fnt.setPointSize( fnt.pointSize()-1 ); 224 if( _pCfg->getUseSmallFont() )
225 {
226 fnt.setPointSize( fnt.pointSize()-1 );
227 }
225 tranTable->setFont( fnt ); 228 tranTable->setFont( fnt );
226 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); 229 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) );
227 tranTable->addColumn( tr( "Id" ) ); 230 tranTable->addColumn( tr( "Id" ) );
228 tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); 231 tranTable->setColumnWidthMode( COL_ID, QListView::Manual );
229 tranTable->setColumnWidth( COL_ID, 0); 232 tranTable->setColumnWidth( COL_ID, 0);
230 tranTable->addColumn( tr( "SortDate" ) ); 233 tranTable->addColumn( tr( "SortDate" ) );
diff --git a/noncore/apps/checkbook/configuration.cpp b/noncore/apps/checkbook/configuration.cpp
index 872d9b2..929c7c0 100644
--- a/noncore/apps/checkbook/configuration.cpp
+++ b/noncore/apps/checkbook/configuration.cpp
@@ -143,20 +143,26 @@ QWidget *Configuration::initSettings(Cfg &cfg)
143 savePayees = new QCheckBox( tr("Save new description as payee"), container ); 143 savePayees = new QCheckBox( tr("Save new description as payee"), container );
144 QWhatsThis::add( savePayees, tr("Click here to save new descriptions in the list of payess.") ); 144 QWhatsThis::add( savePayees, tr("Click here to save new descriptions in the list of payess.") );
145 savePayees->setMaximumHeight(fh+5); 145 savePayees->setMaximumHeight(fh+5);
146 savePayees->setChecked( cfg.getSavePayees() ); 146 savePayees->setChecked( cfg.getSavePayees() );
147 layout->addMultiCellWidget( savePayees, 5, 5, 0, 1 ); 147 layout->addMultiCellWidget( savePayees, 5, 5, 0, 1 );
148 148
149 smallFontCB = new QCheckBox( tr( "Use smaller font for list" ), container );
150 QWhatsThis::add( smallFontCB, tr( "Click here to select smaller font for transactions." ) );
151 smallFontCB->setChecked( cfg.getUseSmallFont() );
152 layout->addMultiCellWidget( smallFontCB, 6, 6, 0, 1 );
153
149 return(control); 154 return(control);
150} 155}
151 156
152// --- saveConfig ------------------------------------------------------------- 157// --- saveConfig -------------------------------------------------------------
153void Configuration::saveConfig(Cfg &cfg) 158void Configuration::saveConfig(Cfg &cfg)
154{ 159{
155 // Settings 160 // Settings
156 cfg.setCurrencySymbol( symbolEdit->text() ); 161 cfg.setCurrencySymbol( symbolEdit->text() );
162 cfg.setUseSmallFont( smallFontCB->isChecked() );
157 cfg.setShowLocks( lockCB->isChecked() ); 163 cfg.setShowLocks( lockCB->isChecked() );
158 cfg.setShowBalances( balCB->isChecked() ); 164 cfg.setShowBalances( balCB->isChecked() );
159 cfg.setOpenLastBook( openLastBookCB->isChecked() ); 165 cfg.setOpenLastBook( openLastBookCB->isChecked() );
160 cfg.setShowLastTab( lastTabCB->isChecked() ); 166 cfg.setShowLastTab( lastTabCB->isChecked() );
161 cfg.setSavePayees( savePayees->isChecked() ); 167 cfg.setSavePayees( savePayees->isChecked() );
162 168
diff --git a/noncore/apps/checkbook/configuration.h b/noncore/apps/checkbook/configuration.h
index 663514d..44c9717 100644
--- a/noncore/apps/checkbook/configuration.h
+++ b/noncore/apps/checkbook/configuration.h
@@ -45,12 +45,13 @@ class Configuration : public QDialog
45 public: 45 public:
46 // Constructor 46 // Constructor
47 Configuration( QWidget *, Cfg &cfg); 47 Configuration( QWidget *, Cfg &cfg);
48 ~Configuration(); 48 ~Configuration();
49 49
50 QLineEdit *symbolEdit; 50 QLineEdit *symbolEdit;
51 QCheckBox *smallFontCB;
51 QCheckBox *lockCB; 52 QCheckBox *lockCB;
52 QCheckBox *balCB; 53 QCheckBox *balCB;
53 QCheckBox *openLastBookCB; 54 QCheckBox *openLastBookCB;
54 QCheckBox *lastTabCB; 55 QCheckBox *lastTabCB;
55 QCheckBox *savePayees; 56 QCheckBox *savePayees;
56 QTabWidget *_mainWidget; 57 QTabWidget *_mainWidget;