author | drw <drw> | 2005-05-04 22:20:27 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-04 22:20:27 (UTC) |
commit | 5db2256e7e342f290e17096cf70b8b318bfcd987 (patch) (unidiff) | |
tree | 771eae383e635aa9117944984b1ec6a4d96973be /core/settings/launcher/tabssettings.cpp | |
parent | 4d719fdcf636f855cb2def7c715a13420ce8a1b6 (diff) | |
download | opie-5db2256e7e342f290e17096cf70b8b318bfcd987.zip opie-5db2256e7e342f290e17096cf70b8b318bfcd987.tar.gz opie-5db2256e7e342f290e17096cf70b8b318bfcd987.tar.bz2 |
Resource -> OResource
Diffstat (limited to 'core/settings/launcher/tabssettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index fca6b20..e7660ef 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -1,54 +1,55 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "tabssettings.h" | 28 | #include "tabssettings.h" |
29 | 29 | ||
30 | #include <qpe/resource.h> | 30 | #include <opie2/oresource.h> |
31 | |||
31 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
32 | #include <qpe/mimetype.h> | 33 | #include <qpe/mimetype.h> |
33 | #include <qpe/qcopenvelope_qws.h> | 34 | #include <qpe/qcopenvelope_qws.h> |
34 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
35 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
36 | 37 | ||
37 | #include <qlistbox.h> | 38 | #include <qlistbox.h> |
38 | #include <qpushbutton.h> | 39 | #include <qpushbutton.h> |
39 | #include <qlayout.h> | 40 | #include <qlayout.h> |
40 | #include <qlabel.h> | 41 | #include <qlabel.h> |
41 | #include <qwhatsthis.h> | 42 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | 43 | #include <qcheckbox.h> |
43 | 44 | ||
44 | #include "tabdialog.h" | 45 | #include "tabdialog.h" |
45 | 46 | ||
46 | #include <stdlib.h> | 47 | #include <stdlib.h> |
47 | #include <qmessagebox.h> | 48 | #include <qmessagebox.h> |
48 | 49 | ||
49 | 50 | ||
50 | #define GLOBALID ".global." | 51 | #define GLOBALID ".global." |
51 | 52 | ||
52 | 53 | ||
53 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 54 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) |
54 | : QWidget ( parent, name ) | 55 | : QWidget ( parent, name ) |
@@ -92,52 +93,49 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | |||
92 | 93 | ||
93 | init ( ); | 94 | init ( ); |
94 | 95 | ||
95 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | 96 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); |
96 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 97 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
97 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | 98 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); |
98 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 99 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
99 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); | 100 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); |
100 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); | 101 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); |
101 | QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." )); | 102 | QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." )); |
102 | } | 103 | } |
103 | 104 | ||
104 | void TabsSettings::init ( ) | 105 | void TabsSettings::init ( ) |
105 | { | 106 | { |
106 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 107 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
107 | QStringList types = rootFolder. types ( ); | 108 | QStringList types = rootFolder. types ( ); |
108 | 109 | ||
109 | m_list-> insertItem ( tr( "All Tabs" )); | 110 | m_list-> insertItem ( tr( "All Tabs" )); |
110 | m_ids << GLOBALID; | 111 | m_ids << GLOBALID; |
111 | 112 | ||
112 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 113 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
113 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 114 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
114 | m_ids << *it; | 115 | m_ids << *it; |
115 | } | 116 | } |
116 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 117 | m_list-> insertItem ( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ), tr( "Documents" ) ); |
117 | QPixmap pix; | ||
118 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | ||
119 | m_list-> insertItem ( pix, tr( "Documents" )); | ||
120 | m_ids += "Documents"; // No tr | 118 | m_ids += "Documents"; // No tr |
121 | 119 | ||
122 | Config cfg ( "Launcher" ); | 120 | Config cfg ( "Launcher" ); |
123 | 121 | ||
124 | readTabSettings ( cfg ); | 122 | readTabSettings ( cfg ); |
125 | 123 | ||
126 | cfg. setGroup ( "GUI" ); | 124 | cfg. setGroup ( "GUI" ); |
127 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); | 125 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); |
128 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); | 126 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); |
129 | m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) ); | 127 | m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) ); |
130 | } | 128 | } |
131 | 129 | ||
132 | 130 | ||
133 | void TabsSettings::readTabSettings ( Config &cfg ) | 131 | void TabsSettings::readTabSettings ( Config &cfg ) |
134 | { | 132 | { |
135 | QString grp ( "Tab %1" ); // No tr | 133 | QString grp ( "Tab %1" ); // No tr |
136 | m_tabs. clear ( ); | 134 | m_tabs. clear ( ); |
137 | 135 | ||
138 | TabConfig global_def; | 136 | TabConfig global_def; |
139 | global_def. m_view = TabConfig::Icon; | 137 | global_def. m_view = TabConfig::Icon; |
140 | global_def. m_bg_type = TabConfig::Ruled; | 138 | global_def. m_bg_type = TabConfig::Ruled; |
141 | global_def. m_bg_image = "launcher/opie-background"; | 139 | global_def. m_bg_image = "launcher/opie-background"; |
142 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); | 140 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); |
143 | global_def. m_iconcolumns = 0; // automatic | 141 | global_def. m_iconcolumns = 0; // automatic |