author | zecke <zecke> | 2002-04-15 20:53:57 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-15 20:53:57 (UTC) |
commit | e010d922ac415558e5efd35e69e39e45908b5501 (patch) (unidiff) | |
tree | 7b6dac3a82613fdefb15c818541891f577ecf48d /libopie/ofontmenu.cc | |
parent | 15244683bb97d303d0d3b6104b46a9b429aaed85 (diff) | |
download | opie-e010d922ac415558e5efd35e69e39e45908b5501.zip opie-e010d922ac415558e5efd35e69e39e45908b5501.tar.gz opie-e010d922ac415558e5efd35e69e39e45908b5501.tar.bz2 |
updates?
too much to remember
-rw-r--r-- | libopie/ofontmenu.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libopie/ofontmenu.cc b/libopie/ofontmenu.cc index 2acae1c..52ff3ee 100644 --- a/libopie/ofontmenu.cc +++ b/libopie/ofontmenu.cc | |||
@@ -1,4 +1,6 @@ | |||
1 | 1 | ||
2 | |||
3 | #include <qpe/config.h> | ||
2 | #include "ofontmenu.h" | 4 | #include "ofontmenu.h" |
3 | 5 | ||
4 | 6 | ||
@@ -7,6 +9,8 @@ OFontMenu::OFontMenu(QWidget *parent, const char *name, const QList<QWidget> &li | |||
7 | : QPopupMenu( parent, name ) | 9 | : QPopupMenu( parent, name ) |
8 | { | 10 | { |
9 | m_list = list; | 11 | m_list = list; |
12 | m_wids.setAutoDelete( TRUE ); | ||
13 | |||
10 | insertItem(tr("Large"), this, SLOT(slotLarge() ), | 14 | insertItem(tr("Large"), this, SLOT(slotLarge() ), |
11 | 0, 10); | 15 | 0, 10); |
12 | insertItem(tr("Medium"), this, SLOT(slotMedium() ), | 16 | insertItem(tr("Medium"), this, SLOT(slotMedium() ), |
@@ -14,6 +18,34 @@ OFontMenu::OFontMenu(QWidget *parent, const char *name, const QList<QWidget> &li | |||
14 | insertItem(tr("Small"), this, SLOT(slotSmall() ), | 18 | insertItem(tr("Small"), this, SLOT(slotSmall() ), |
15 | 0, 12 ); | 19 | 0, 12 ); |
16 | setCheckable( true ); | 20 | setCheckable( true ); |
21 | m_size=10; | ||
22 | } | ||
23 | void OFontMenu::save(Config *cfg ) | ||
24 | { | ||
25 | cfg->setGroup("OFontMenu" ); | ||
26 | cfg->writeEntry("size", m_size ); | ||
27 | } | ||
28 | void OFontMenu::restore(Config *cfg ) | ||
29 | { | ||
30 | cfg->setGroup("OFontMeny" ); | ||
31 | m_size = cfg->readNumEntry("size" ); | ||
32 | setItemChecked(10, false ); | ||
33 | setItemChecked(11, false ); | ||
34 | setItemChecked(12, false ); | ||
35 | switch( m_size ){ | ||
36 | case 8: | ||
37 | setItemChecked(12, true ); | ||
38 | break; | ||
39 | case 14: | ||
40 | setItemChecked(10, true ); | ||
41 | break; | ||
42 | case 10:// fall through | ||
43 | default: | ||
44 | setItemChecked(11, true ); | ||
45 | m_size = 10; | ||
46 | break; | ||
47 | } | ||
48 | setFontSize( m_size ); | ||
17 | } | 49 | } |
18 | void OFontMenu::setWidgets(const QList<QWidget> &list ) | 50 | void OFontMenu::setWidgets(const QList<QWidget> &list ) |
19 | { | 51 | { |
@@ -61,6 +93,7 @@ void OFontMenu::slotLarge() | |||
61 | } | 93 | } |
62 | void OFontMenu::setFontSize(int size ) | 94 | void OFontMenu::setFontSize(int size ) |
63 | { | 95 | { |
96 | m_size = size; | ||
64 | QWidget *wid; | 97 | QWidget *wid; |
65 | for(wid = m_list.first(); wid !=0; wid = m_list.next() ){ | 98 | for(wid = m_list.first(); wid !=0; wid = m_list.next() ){ |
66 | QFont font = wid->font(); | 99 | QFont font = wid->font(); |
@@ -75,4 +108,5 @@ void OFontMenu::setFontSize(int size ) | |||
75 | wids->wid->setFont( font ); | 108 | wids->wid->setFont( font ); |
76 | } | 109 | } |
77 | } | 110 | } |
111 | emit fontChanged(size ); | ||
78 | } | 112 | } |