summaryrefslogtreecommitdiff
path: root/core/settings/launcher/guisettings.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/guisettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/guisettings.cpp153
1 files changed, 0 insertions, 153 deletions
diff --git a/core/settings/launcher/guisettings.cpp b/core/settings/launcher/guisettings.cpp
deleted file mode 100644
index a292663..0000000
--- a/core/settings/launcher/guisettings.cpp
+++ b/dev/null
@@ -1,153 +0,0 @@
1/*
2                This file is part of the OPIE Project
3 =. Copyright (c) 2002 Trolltech AS <info@trolltech.com>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "guisettings.h"
30
31#include <qpe/config.h>
32#include <qpe/qpeapplication.h>
33#include <qpe/qcopenvelope_qws.h>
34
35#include <qlistview.h>
36#include <qcheckbox.h>
37#include <qheader.h>
38#include <qlayout.h>
39#include <qlabel.h>
40#include <qwhatsthis.h>
41
42#include <stdlib.h>
43
44
45GuiSettings::GuiSettings ( QWidget *parent, const char *name )
46 : QWidget ( parent, name )
47{
48 m_menu_changed = false;
49 m_busy_changed = false;
50
51 QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 );
52 lay-> addColSpacing ( 0, 16 );
53
54 m_omenu = new QCheckBox ( tr( "Show O-Menu" ), this );
55 lay-> addMultiCellWidget ( m_omenu, 0, 0, 0, 1 );
56
57 m_omenu_tabs = new QCheckBox ( tr( "Add Launcher tabs to O-Menu" ), this );
58 lay-> addWidget ( m_omenu_tabs, 1, 1 );
59
60 m_omenu_home = new QCheckBox ( tr( "Add 'Home' shortcut to O-Menu" ), this );
61 lay-> addWidget ( m_omenu_home, 2, 1 );
62
63 m_omenu_suspend = new QCheckBox ( tr( "Add 'Suspend' shortcut to O-Menu" ), this );
64 lay-> addWidget ( m_omenu_suspend, 3, 1 );
65
66 QWhatsThis::add( m_omenu_tabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." ));
67 QWhatsThis::add( m_omenu, tr( "Check if you want the O-Menu in the taskbar." ));
68
69 connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_tabs, SLOT( setEnabled ( bool )));
70 connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_home, SLOT( setEnabled ( bool )));
71 connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_suspend, SLOT( setEnabled ( bool )));
72
73 connect ( m_omenu, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( )));
74 connect ( m_omenu_tabs, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( )));
75 connect ( m_omenu_home, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( )));
76 connect ( m_omenu_suspend, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( )));
77
78 lay-> addRowSpacing ( 4, 8 );
79
80 m_busy = new QCheckBox ( tr( "Enable blinking busy indicator" ), this );
81 lay-> addMultiCellWidget ( m_busy, 5, 5, 0, 1 );
82
83 connect ( m_busy, SIGNAL( toggled( bool )), this, SLOT( busyChanged ( )));
84
85 lay-> setRowStretch ( 6, 10 );
86
87 init ( );
88}
89
90void GuiSettings::init ( )
91{
92 Config cfg ( "Taskbar" );
93 cfg. setGroup ( "Menu" );
94
95 m_omenu-> setChecked ( cfg. readBoolEntry ( "ShowMenu", true ));
96 m_omenu_tabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true ));
97 m_omenu_home-> setChecked ( cfg. readBoolEntry ( "Home", true ));
98 m_omenu_suspend-> setChecked ( cfg. readBoolEntry ( "Suspend", true ));
99
100 m_omenu_tabs-> setEnabled ( m_omenu-> isChecked ( ));
101 m_omenu_home-> setEnabled ( m_omenu-> isChecked ( ));
102 m_omenu_suspend-> setEnabled ( m_omenu-> isChecked ( ));
103
104 Config cfg2 ( "Launcher" );
105 cfg2. setGroup ( "GUI" );
106
107 m_busy-> setChecked ( cfg2. readEntry ( "BusyType" ). lower ( ) == "blink" );
108}
109
110void GuiSettings::menuChanged()
111{
112 m_menu_changed = true;
113}
114
115void GuiSettings::busyChanged()
116{
117 m_busy_changed = true;
118}
119
120void GuiSettings::accept ( )
121{
122 Config cfg ( "Taskbar" );
123 cfg. setGroup ( "Menu" );
124
125 if ( m_menu_changed ) {
126 cfg. writeEntry ( "ShowMenu", m_omenu-> isChecked ( ));
127 cfg. writeEntry ( "LauncherTabs", m_omenu_tabs-> isChecked ( ));
128 cfg. writeEntry ( "Home", m_omenu_home-> isChecked ( ));
129 cfg. writeEntry ( "Suspend", m_omenu_suspend-> isChecked ( ));
130 }
131 cfg. write ( );
132
133 if ( m_menu_changed )
134 QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" );
135
136 Config cfg2 ( "Launcher" );
137 cfg2. setGroup ( "GUI" );
138
139 QString busytype = QString ( m_busy-> isChecked ( ) ? "blink" : "" );
140
141 if ( m_busy_changed ) {
142
143 cfg2. writeEntry ( "BusyType", busytype );
144 }
145
146 cfg2. write ( );
147
148 if ( m_busy_changed ) {
149 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
150 e << busytype;
151 }
152}
153