Diffstat (limited to 'core/settings/launcher/tabssettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 8f5f7fa..6cc69c0 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -30,24 +30,25 @@ | |||
30 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
33 | #include <qpe/mimetype.h> | 33 | #include <qpe/mimetype.h> |
34 | #include <qpe/qcopenvelope_qws.h> | 34 | #include <qpe/qcopenvelope_qws.h> |
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | 36 | ||
37 | #include <qlistbox.h> | 37 | #include <qlistbox.h> |
38 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | ||
42 | 43 | ||
43 | #include "tabdialog.h" | 44 | #include "tabdialog.h" |
44 | 45 | ||
45 | #include <stdlib.h> | 46 | #include <stdlib.h> |
46 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
47 | 48 | ||
48 | 49 | ||
49 | 50 | ||
50 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 51 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) |
51 | : QWidget ( parent, name ) | 52 | : QWidget ( parent, name ) |
52 | { | 53 | { |
53 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); | 54 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); |
@@ -66,48 +67,55 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | |||
66 | connect ( p, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); | 67 | connect ( p, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); |
67 | 68 | ||
68 | p = new QPushButton ( tr( "Edit" ), this ); | 69 | p = new QPushButton ( tr( "Edit" ), this ); |
69 | lay-> addWidget ( p, 2, 1 ); | 70 | lay-> addWidget ( p, 2, 1 ); |
70 | connect ( p, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); | 71 | connect ( p, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); |
71 | 72 | ||
72 | p = new QPushButton ( tr( "Delete" ), this ); | 73 | p = new QPushButton ( tr( "Delete" ), this ); |
73 | lay-> addWidget ( p, 3, 1 ); | 74 | lay-> addWidget ( p, 3, 1 ); |
74 | connect ( p, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); | 75 | connect ( p, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); |
75 | 76 | ||
76 | lay-> setRowStretch ( 4, 10 ); | 77 | lay-> setRowStretch ( 4, 10 ); |
77 | 78 | ||
79 | m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); | ||
80 | lay-> addMultiCellWidget ( m_busyblink, 5, 5, 0, 1 ); | ||
81 | |||
78 | init ( ); | 82 | init ( ); |
79 | } | 83 | } |
80 | 84 | ||
81 | void TabsSettings::init ( ) | 85 | void TabsSettings::init ( ) |
82 | { | 86 | { |
83 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 87 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
84 | QStringList types = rootFolder. types ( ); | 88 | QStringList types = rootFolder. types ( ); |
85 | 89 | ||
86 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 90 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
87 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 91 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
88 | m_ids << *it; | 92 | m_ids << *it; |
89 | } | 93 | } |
90 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 94 | QImage img ( Resource::loadImage ( "DocsIcon" )); |
91 | QPixmap pix; | 95 | QPixmap pix; |
92 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | 96 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); |
93 | m_list-> insertItem ( pix, tr( "Documents" )); | 97 | m_list-> insertItem ( pix, tr( "Documents" )); |
94 | m_ids += "Documents"; // No tr | 98 | m_ids += "Documents"; // No tr |
95 | 99 | ||
96 | readTabSettings ( ); | 100 | Config cfg ( "Launcher" ); |
101 | |||
102 | readTabSettings ( cfg ); | ||
103 | |||
104 | cfg. setGroup ( "GUI" ); | ||
105 | m_busyblink-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "blink" ); | ||
97 | } | 106 | } |
98 | 107 | ||
99 | void TabsSettings::readTabSettings ( ) | 108 | void TabsSettings::readTabSettings ( Config &cfg ) |
100 | { | 109 | { |
101 | Config cfg ( "Launcher" ); | ||
102 | QString grp ( "Tab %1" ); // No tr | 110 | QString grp ( "Tab %1" ); // No tr |
103 | m_tabs. clear ( ); | 111 | m_tabs. clear ( ); |
104 | 112 | ||
105 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 113 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
106 | TabConfig tc; | 114 | TabConfig tc; |
107 | tc. m_view = TabConfig::Icon; | 115 | tc. m_view = TabConfig::Icon; |
108 | tc. m_bg_type = TabConfig::Ruled; | 116 | tc. m_bg_type = TabConfig::Ruled; |
109 | tc. m_changed = false; | 117 | tc. m_changed = false; |
110 | 118 | ||
111 | cfg. setGroup ( grp. arg ( *it )); | 119 | cfg. setGroup ( grp. arg ( *it )); |
112 | 120 | ||
113 | QString view = cfg. readEntry ( "View", "Icon" ); | 121 | QString view = cfg. readEntry ( "View", "Icon" ); |
@@ -189,24 +197,32 @@ void TabsSettings::accept ( ) | |||
189 | } | 197 | } |
190 | 198 | ||
191 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); | 199 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); |
192 | te << *it << tc. m_text_color; | 200 | te << *it << tc. m_text_color; |
193 | 201 | ||
194 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); | 202 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); |
195 | fe << *it << tc. m_font_family; | 203 | fe << *it << tc. m_font_family; |
196 | fe << tc. m_font_size; | 204 | fe << tc. m_font_size; |
197 | fe << tc. m_font_weight << ( tc. m_font_italic ? 1 : 0 ); | 205 | fe << tc. m_font_weight << ( tc. m_font_italic ? 1 : 0 ); |
198 | 206 | ||
199 | tc. m_changed = false; | 207 | tc. m_changed = false; |
200 | } | 208 | } |
209 | cfg. setGroup ( "GUI" ); | ||
210 | QString busytype = QString ( m_busyblink-> isChecked ( ) ? "blink" : "" ); | ||
211 | |||
212 | cfg. writeEntry ( "BusyType", busytype ); | ||
213 | { | ||
214 | QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); | ||
215 | e << busytype; | ||
216 | } | ||
201 | } | 217 | } |
202 | 218 | ||
203 | void TabsSettings::newClicked ( ) | 219 | void TabsSettings::newClicked ( ) |
204 | { | 220 | { |
205 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); | 221 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); |
206 | } | 222 | } |
207 | 223 | ||
208 | void TabsSettings::deleteClicked ( ) | 224 | void TabsSettings::deleteClicked ( ) |
209 | { | 225 | { |
210 | int ind = m_list-> currentItem ( ); | 226 | int ind = m_list-> currentItem ( ); |
211 | 227 | ||
212 | if ( ind < 0 ) | 228 | if ( ind < 0 ) |