-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 2 | ||||
-rw-r--r-- | core/settings/launcher/menusettings.cpp | 4 | ||||
-rw-r--r-- | core/settings/launcher/tabconfig.h | 13 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 5 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 65 |
5 files changed, 73 insertions, 16 deletions
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index c32d998..7b85602 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -27,25 +27,25 @@ | |||
27 | 27 | ||
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | 30 | ||
31 | #include <opie/otabwidget.h> | 31 | #include <opie/otabwidget.h> |
32 | 32 | ||
33 | #include "launchersettings.h" | 33 | #include "launchersettings.h" |
34 | #include "tabssettings.h" | 34 | #include "tabssettings.h" |
35 | #include "menusettings.h" | 35 | #include "menusettings.h" |
36 | #include "taskbarsettings.h" | 36 | #include "taskbarsettings.h" |
37 | 37 | ||
38 | 38 | ||
39 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false ) | 39 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) |
40 | { | 40 | { |
41 | setCaption ( tr( "Launcher Settings" )); | 41 | setCaption ( tr( "Launcher Settings" )); |
42 | 42 | ||
43 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 43 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
44 | 44 | ||
45 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 45 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
46 | lay-> addWidget ( tw ); | 46 | lay-> addWidget ( tw ); |
47 | 47 | ||
48 | m_tabs = new TabsSettings ( tw ); | 48 | m_tabs = new TabsSettings ( tw ); |
49 | m_taskbar = new TaskbarSettings ( tw ); | 49 | m_taskbar = new TaskbarSettings ( tw ); |
50 | m_menu = new MenuSettings ( tw ); | 50 | m_menu = new MenuSettings ( tw ); |
51 | 51 | ||
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index 8d363fa..5a9fada 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp | |||
@@ -55,26 +55,26 @@ MenuSettings::MenuSettings ( QWidget *parent, const char *name ) | |||
55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); | 55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); |
56 | lay-> addWidget ( l ); | 56 | lay-> addWidget ( l ); |
57 | 57 | ||
58 | m_list = new QListView ( this ); | 58 | m_list = new QListView ( this ); |
59 | m_list-> addColumn ( "foobar" ); | 59 | m_list-> addColumn ( "foobar" ); |
60 | m_list-> header ( )-> hide ( ); | 60 | m_list-> header ( )-> hide ( ); |
61 | 61 | ||
62 | lay-> addWidget ( m_list ); | 62 | lay-> addWidget ( m_list ); |
63 | 63 | ||
64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); | 64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); |
65 | lay-> addWidget ( m_menutabs ); | 65 | lay-> addWidget ( m_menutabs ); |
66 | 66 | ||
67 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the O-Menu." )); | 67 | QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); |
68 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." )); | 68 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); |
69 | 69 | ||
70 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 70 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); |
71 | 71 | ||
72 | init ( ); | 72 | init ( ); |
73 | } | 73 | } |
74 | 74 | ||
75 | void MenuSettings::init ( ) | 75 | void MenuSettings::init ( ) |
76 | { | 76 | { |
77 | Config cfg ( "StartMenu" ); | 77 | Config cfg ( "StartMenu" ); |
78 | cfg. setGroup ( "Applets" ); | 78 | cfg. setGroup ( "Applets" ); |
79 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 79 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
80 | 80 | ||
diff --git a/core/settings/launcher/tabconfig.h b/core/settings/launcher/tabconfig.h index 8b6b103..eebfd36 100644 --- a/core/settings/launcher/tabconfig.h +++ b/core/settings/launcher/tabconfig.h | |||
@@ -39,15 +39,28 @@ struct TabConfig { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | ViewMode m_view; | 41 | ViewMode m_view; |
42 | BackgroundType m_bg_type; | 42 | BackgroundType m_bg_type; |
43 | QString m_bg_image; | 43 | QString m_bg_image; |
44 | QString m_bg_color; | 44 | QString m_bg_color; |
45 | QString m_text_color; | 45 | QString m_text_color; |
46 | QString m_font_family; | 46 | QString m_font_family; |
47 | int m_font_size; | 47 | int m_font_size; |
48 | int m_font_weight; | 48 | int m_font_weight; |
49 | bool m_font_italic; | 49 | bool m_font_italic; |
50 | bool m_changed; | 50 | bool m_changed; |
51 | |||
52 | bool operator == ( const TabConfig &tc ) | ||
53 | { | ||
54 | return ( m_view == tc. m_view ) && | ||
55 | ( m_bg_type == tc. m_bg_type ) && | ||
56 | ( m_bg_image == tc. m_bg_image ) && | ||
57 | ( m_bg_color == tc. m_bg_color ) && | ||
58 | ( m_text_color == tc. m_text_color ) && | ||
59 | ( m_font_family == tc. m_font_family ) && | ||
60 | ( m_font_size == tc. m_font_size ) && | ||
61 | ( m_font_weight == tc. m_font_weight ) && | ||
62 | ( m_font_italic == tc. m_font_italic ); | ||
63 | } | ||
51 | }; | 64 | }; |
52 | 65 | ||
53 | #endif | 66 | #endif |
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 6288f5f..a90ba7d 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -29,24 +29,25 @@ | |||
29 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
30 | #include <qpe/applnk.h> | 30 | #include <qpe/applnk.h> |
31 | 31 | ||
32 | #include <qlayout.h> | 32 | #include <qlayout.h> |
33 | #include <qvbox.h> | 33 | #include <qvbox.h> |
34 | #include <qtabbar.h> | 34 | #include <qtabbar.h> |
35 | #include <qiconview.h> | 35 | #include <qiconview.h> |
36 | #include <qapplication.h> | 36 | #include <qapplication.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qradiobutton.h> | 38 | #include <qradiobutton.h> |
39 | #include <qbuttongroup.h> | 39 | #include <qbuttongroup.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qwhatsthis.h> | ||
41 | 42 | ||
42 | #include <opie/ofontselector.h> | 43 | #include <opie/ofontselector.h> |
43 | #include <opie/otabwidget.h> | 44 | #include <opie/otabwidget.h> |
44 | #include <opie/ocolorbutton.h> | 45 | #include <opie/ocolorbutton.h> |
45 | #include <opie/ofiledialog.h> | 46 | #include <opie/ofiledialog.h> |
46 | 47 | ||
47 | #include "tabdialog.h" | 48 | #include "tabdialog.h" |
48 | 49 | ||
49 | 50 | ||
50 | class SampleItem : public QIconViewItem { | 51 | class SampleItem : public QIconViewItem { |
51 | public: | 52 | public: |
52 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) | 53 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) |
@@ -253,25 +254,25 @@ public: | |||
253 | } | 254 | } |
254 | 255 | ||
255 | private: | 256 | private: |
256 | QColor m_textcolor; | 257 | QColor m_textcolor; |
257 | QColor m_bgcolor; | 258 | QColor m_bgcolor; |
258 | QPixmap m_bgpix; | 259 | QPixmap m_bgpix; |
259 | TabConfig::BackgroundType m_bgtype; | 260 | TabConfig::BackgroundType m_bgtype; |
260 | }; | 261 | }; |
261 | 262 | ||
262 | 263 | ||
263 | 264 | ||
264 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) | 265 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) |
265 | : QDialog ( parent, name, modal, fl ), m_tc ( tc ) | 266 | : QDialog ( parent, name, modal, fl | WStyle_ContextHelp ), m_tc ( tc ) |
266 | { | 267 | { |
267 | setCaption ( tr( "Edit Tab" )); | 268 | setCaption ( tr( "Edit Tab" )); |
268 | 269 | ||
269 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 270 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
270 | 271 | ||
271 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 272 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
272 | QWidget *bgtab; | 273 | QWidget *bgtab; |
273 | 274 | ||
274 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); | 275 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); |
275 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 276 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); |
276 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); | 277 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); |
277 | 278 | ||
@@ -289,24 +290,26 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
289 | lay-> addWidget ( sample, 1 ); | 290 | lay-> addWidget ( sample, 1 ); |
290 | 291 | ||
291 | m_iconsize-> setButton ( tc. m_view ); | 292 | m_iconsize-> setButton ( tc. m_view ); |
292 | iconSizeClicked ( tc. m_view ); | 293 | iconSizeClicked ( tc. m_view ); |
293 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 294 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
294 | iconColorClicked ( m_iconcolor-> color ( )); | 295 | iconColorClicked ( m_iconcolor-> color ( )); |
295 | m_bgtype-> setButton ( tc. m_bg_type ); | 296 | m_bgtype-> setButton ( tc. m_bg_type ); |
296 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 297 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
297 | m_bgimage = tc. m_bg_image; | 298 | m_bgimage = tc. m_bg_image; |
298 | bgTypeClicked ( tc. m_bg_type ); | 299 | bgTypeClicked ( tc. m_bg_type ); |
299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); | 300 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | fontClicked ( m_fontselect-> selectedFont ( )); | 301 | fontClicked ( m_fontselect-> selectedFont ( )); |
302 | |||
303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); | ||
301 | } | 304 | } |
302 | 305 | ||
303 | 306 | ||
304 | TabDialog::~TabDialog ( ) | 307 | TabDialog::~TabDialog ( ) |
305 | { | 308 | { |
306 | } | 309 | } |
307 | 310 | ||
308 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
309 | { | 312 | { |
310 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); | 313 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); |
311 | 314 | ||
312 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 315 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 6cc69c0..a5afaf2 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -38,63 +38,77 @@ | |||
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 | #include <qcheckbox.h> |
43 | 43 | ||
44 | #include "tabdialog.h" | 44 | #include "tabdialog.h" |
45 | 45 | ||
46 | #include <stdlib.h> | 46 | #include <stdlib.h> |
47 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
48 | 48 | ||
49 | 49 | ||
50 | #define GLOBALID "_launchersettings_global_dummy_" | ||
51 | |||
50 | 52 | ||
51 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 53 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) |
52 | : QWidget ( parent, name ) | 54 | : QWidget ( parent, name ) |
53 | { | 55 | { |
54 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); | 56 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); |
55 | 57 | ||
56 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); | 58 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); |
57 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); | 59 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); |
58 | 60 | ||
59 | m_list = new QListBox ( this ); | 61 | m_list = new QListBox ( this ); |
60 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); | 62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); |
61 | 63 | ||
62 | QWhatsThis::add ( m_list, tr( "foobar" )); | 64 | QWhatsThis::add ( m_list, tr( "foobar" )); |
63 | 65 | ||
64 | QPushButton *p; | 66 | QPushButton *p1, *p2, *p3; |
65 | p = new QPushButton ( tr( "New" ), this ); | 67 | p1 = new QPushButton ( tr( "New" ), this ); |
66 | lay-> addWidget ( p, 1, 1 ); | 68 | lay-> addWidget ( p1, 1, 1 ); |
67 | connect ( p, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); | 69 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); |
68 | 70 | ||
69 | p = new QPushButton ( tr( "Edit" ), this ); | 71 | p2 = new QPushButton ( tr( "Edit" ), this ); |
70 | lay-> addWidget ( p, 2, 1 ); | 72 | lay-> addWidget ( p2, 2, 1 ); |
71 | connect ( p, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); | 73 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); |
72 | 74 | ||
73 | p = new QPushButton ( tr( "Delete" ), this ); | 75 | p3 = new QPushButton ( tr( "Delete" ), this ); |
74 | lay-> addWidget ( p, 3, 1 ); | 76 | lay-> addWidget ( p3, 3, 1 ); |
75 | connect ( p, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); | 77 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); |
76 | 78 | ||
77 | lay-> setRowStretch ( 4, 10 ); | 79 | lay-> setRowStretch ( 4, 10 ); |
78 | 80 | ||
79 | m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); | 81 | m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); |
80 | lay-> addMultiCellWidget ( m_busyblink, 5, 5, 0, 1 ); | 82 | lay-> addMultiCellWidget ( m_busyblink, 5, 5, 0, 1 ); |
81 | 83 | ||
84 | p1-> setEnabled ( false ); | ||
85 | p3-> setEnabled ( false ); | ||
86 | |||
82 | init ( ); | 87 | init ( ); |
88 | |||
89 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | ||
90 | 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>." )); | ||
91 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | ||
92 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | ||
93 | QWhatsThis::add ( m_busyblink, tr( "Activate this, if you want a blinking busy indicator for starting applications in the Launcher." )); | ||
83 | } | 94 | } |
84 | 95 | ||
85 | void TabsSettings::init ( ) | 96 | void TabsSettings::init ( ) |
86 | { | 97 | { |
87 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 98 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
88 | QStringList types = rootFolder. types ( ); | 99 | QStringList types = rootFolder. types ( ); |
100 | |||
101 | m_list-> insertItem ( tr( "All Tabs" )); | ||
102 | m_ids << GLOBALID; | ||
89 | 103 | ||
90 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 104 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
91 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 105 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
92 | m_ids << *it; | 106 | m_ids << *it; |
93 | } | 107 | } |
94 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 108 | QImage img ( Resource::loadImage ( "DocsIcon" )); |
95 | QPixmap pix; | 109 | QPixmap pix; |
96 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | 110 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); |
97 | m_list-> insertItem ( pix, tr( "Documents" )); | 111 | m_list-> insertItem ( pix, tr( "Documents" )); |
98 | m_ids += "Documents"; // No tr | 112 | m_ids += "Documents"; // No tr |
99 | 113 | ||
100 | Config cfg ( "Launcher" ); | 114 | Config cfg ( "Launcher" ); |
@@ -108,24 +122,26 @@ void TabsSettings::init ( ) | |||
108 | void TabsSettings::readTabSettings ( Config &cfg ) | 122 | void TabsSettings::readTabSettings ( Config &cfg ) |
109 | { | 123 | { |
110 | QString grp ( "Tab %1" ); // No tr | 124 | QString grp ( "Tab %1" ); // No tr |
111 | m_tabs. clear ( ); | 125 | m_tabs. clear ( ); |
112 | 126 | ||
113 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 127 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
114 | TabConfig tc; | 128 | TabConfig tc; |
115 | tc. m_view = TabConfig::Icon; | 129 | tc. m_view = TabConfig::Icon; |
116 | tc. m_bg_type = TabConfig::Ruled; | 130 | tc. m_bg_type = TabConfig::Ruled; |
117 | tc. m_changed = false; | 131 | tc. m_changed = false; |
118 | 132 | ||
119 | cfg. setGroup ( grp. arg ( *it )); | 133 | cfg. setGroup ( grp. arg ( *it )); |
134 | if ( *it == GLOBALID ) | ||
135 | cfg. clearGroup ( ); | ||
120 | 136 | ||
121 | QString view = cfg. readEntry ( "View", "Icon" ); | 137 | QString view = cfg. readEntry ( "View", "Icon" ); |
122 | if ( view == "List" ) // No tr | 138 | if ( view == "List" ) // No tr |
123 | tc. m_view = TabConfig::List; | 139 | tc. m_view = TabConfig::List; |
124 | 140 | ||
125 | QString bgType = cfg. readEntry ( "BackgroundType", "Image" ); | 141 | QString bgType = cfg. readEntry ( "BackgroundType", "Image" ); |
126 | if ( bgType == "SolidColor" ) | 142 | if ( bgType == "SolidColor" ) |
127 | tc. m_bg_type = TabConfig::SolidColor; | 143 | tc. m_bg_type = TabConfig::SolidColor; |
128 | else if ( bgType == "Image" ) // No tr | 144 | else if ( bgType == "Image" ) // No tr |
129 | tc. m_bg_type = TabConfig::Image; | 145 | tc. m_bg_type = TabConfig::Image; |
130 | 146 | ||
131 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", "launcher/opie-background" ); | 147 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", "launcher/opie-background" ); |
@@ -134,42 +150,60 @@ void TabsSettings::readTabSettings ( Config &cfg ) | |||
134 | QStringList f = cfg. readListEntry ( "Font", ',' ); | 150 | QStringList f = cfg. readListEntry ( "Font", ',' ); |
135 | if ( f. count ( ) == 4 ) { | 151 | if ( f. count ( ) == 4 ) { |
136 | tc. m_font_family = f [0]; | 152 | tc. m_font_family = f [0]; |
137 | tc. m_font_size = f [1]. toInt ( ); | 153 | tc. m_font_size = f [1]. toInt ( ); |
138 | tc. m_font_weight = f [2]. toInt ( ); | 154 | tc. m_font_weight = f [2]. toInt ( ); |
139 | tc. m_font_italic = ( f [3]. toInt ( )); | 155 | tc. m_font_italic = ( f [3]. toInt ( )); |
140 | } else { | 156 | } else { |
141 | tc. m_font_family = font ( ). family ( ); | 157 | tc. m_font_family = font ( ). family ( ); |
142 | tc. m_font_size = font ( ). pointSize ( ); | 158 | tc. m_font_size = font ( ). pointSize ( ); |
143 | tc. m_font_weight = 50; | 159 | tc. m_font_weight = 50; |
144 | tc. m_font_italic = false; | 160 | tc. m_font_italic = false; |
145 | } | 161 | } |
162 | |||
146 | m_tabs [*it] = tc; | 163 | m_tabs [*it] = tc; |
147 | } | 164 | } |
165 | |||
166 | // if all tabs have the same config, then initialize the GLOBALID tab to these values | ||
167 | |||
168 | TabConfig *first = 0; | ||
169 | bool same = true; | ||
170 | |||
171 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | ||
172 | if ( *it == GLOBALID ) | ||
173 | continue; | ||
174 | else if ( !first ) | ||
175 | first = &m_tabs [*it]; | ||
176 | else | ||
177 | same &= ( *first == m_tabs [*it] ); | ||
178 | } | ||
179 | if ( same ) | ||
180 | m_tabs [GLOBALID] = *first; | ||
148 | } | 181 | } |
149 | 182 | ||
150 | 183 | ||
151 | void TabsSettings::accept ( ) | 184 | void TabsSettings::accept ( ) |
152 | { | 185 | { |
153 | Config cfg ( "Launcher" ); | 186 | Config cfg ( "Launcher" ); |
154 | 187 | ||
155 | // Launcher Tab | 188 | // Launcher Tab |
156 | QString grp ( "Tab %1" ); // No tr | 189 | QString grp ( "Tab %1" ); // No tr |
157 | 190 | ||
158 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 191 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
159 | TabConfig &tc = m_tabs [*it]; | 192 | TabConfig &tc = m_tabs [*it]; |
160 | 193 | ||
161 | cfg. setGroup ( grp. arg ( *it )); | 194 | if ( !tc. m_changed || ( *it == GLOBALID )) |
162 | if ( !tc. m_changed ) | ||
163 | continue; | 195 | continue; |
196 | |||
197 | cfg. setGroup ( grp. arg ( *it )); | ||
164 | switch ( tc. m_view ) { | 198 | switch ( tc. m_view ) { |
165 | case TabConfig::Icon: | 199 | case TabConfig::Icon: |
166 | cfg.writeEntry ( "View", "Icon" ); | 200 | cfg.writeEntry ( "View", "Icon" ); |
167 | break; | 201 | break; |
168 | case TabConfig::List: | 202 | case TabConfig::List: |
169 | cfg.writeEntry ( "View", "List" ); | 203 | cfg.writeEntry ( "View", "List" ); |
170 | break; | 204 | break; |
171 | } | 205 | } |
172 | 206 | ||
173 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); | 207 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); |
174 | e << *it << tc. m_view; | 208 | e << *it << tc. m_view; |
175 | 209 | ||
@@ -237,16 +271,23 @@ void TabsSettings::editClicked ( ) | |||
237 | 271 | ||
238 | if ( ind < 0 ) | 272 | if ( ind < 0 ) |
239 | return; | 273 | return; |
240 | 274 | ||
241 | TabConfig tc = m_tabs [m_ids [ind]]; | 275 | TabConfig tc = m_tabs [m_ids [ind]]; |
242 | 276 | ||
243 | TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true ); | 277 | TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true ); |
244 | 278 | ||
245 | d-> showMaximized ( ); | 279 | d-> showMaximized ( ); |
246 | if ( d-> exec ( ) == QDialog::Accepted ) { | 280 | if ( d-> exec ( ) == QDialog::Accepted ) { |
247 | tc. m_changed = true; | 281 | tc. m_changed = true; |
248 | m_tabs [m_ids [ind]] = tc; | 282 | m_tabs [m_ids [ind]] = tc; |
283 | |||
284 | if ( m_ids [ind] == GLOBALID ) { | ||
285 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | ||
286 | if ( *it != GLOBALID ) | ||
287 | m_tabs [*it] = tc; | ||
288 | } | ||
289 | } | ||
249 | } | 290 | } |
250 | 291 | ||
251 | delete d; | 292 | delete d; |
252 | } | 293 | } |