summaryrefslogtreecommitdiff
authordrw <drw>2002-12-16 00:26:32 (UTC)
committer drw <drw>2002-12-16 00:26:32 (UTC)
commite4057ee7fe74c83e2dc44f8b9870f65da60fc4fa (patch) (side-by-side diff)
tree027cebbca343052e970c90e7eed3447e14b58e39
parenta6a23d1c30e395add577eec261ae728f8d783299 (diff)
downloadopie-e4057ee7fe74c83e2dc44f8b9870f65da60fc4fa.zip
opie-e4057ee7fe74c83e2dc44f8b9870f65da60fc4fa.tar.gz
opie-e4057ee7fe74c83e2dc44f8b9870f65da60fc4fa.tar.bz2
QWhatsThis added
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp69
-rw-r--r--noncore/settings/appearance2/editScheme.cpp7
2 files changed, 62 insertions, 14 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index f611799..2f3ba74 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -49,2 +49,3 @@
#include <qvbox.h>
+#include <qwhatsthis.h>
@@ -54,2 +55,3 @@
#include <qpe/qpeapplication.h>
+#include <qpe/qpemessagebox.h>
#include <qpe/qcopenvelope_qws.h>
@@ -117,2 +119,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
vertLayout->addWidget( m_style_list );
+ QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) );
@@ -121,2 +124,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
vertLayout-> addWidget ( m_style_settings );
+ QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) );
@@ -133,3 +137,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
{
- QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/";
+ QString path = QPEApplication::qpeDir ( );
+ path.append( "/plugins/styles/" );
QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
@@ -137,3 +142,6 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
- QLibrary *lib = new QLibrary ( path + "/" + *it );
+ QString libstr = path;
+ libstr.append( "/" );
+ libstr.append( *it );
+ QLibrary *lib = new QLibrary ( libstr );
StyleInterface *iface;
@@ -167,2 +175,3 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
vertLayout->addWidget( m_deco_list );
+ QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) );
@@ -173,3 +182,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
{
- QString path = QPEApplication::qpeDir() + "/plugins/decorations/";
+ QString path = QPEApplication::qpeDir();
+ path.append( "/plugins/decorations/" );
QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
@@ -177,3 +187,6 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
- QLibrary *lib = new QLibrary ( path + "/" + *it );
+ QString libstr = path;
+ libstr.append( "/" );
+ libstr.append( *it );
+ QLibrary *lib = new QLibrary ( libstr );
WindowDecorationInterface *iface;
@@ -210,2 +223,3 @@ QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg )
m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
+ QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) );
@@ -226,2 +240,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) );
+ QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) );
@@ -229,3 +244,4 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
- QString path = QPEApplication::qpeDir ( ) + "/etc/colors/";
+ QString path = QPEApplication::qpeDir ( );
+ path.append( "/etc/colors/" );
QStringList sl = QDir ( path ). entryList ( "*.scheme" );
@@ -234,3 +250,5 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
QString name = (*it). left ((*it). find ( ".scheme" ));
- Config config ( path + *it, Config::File );
+ QString pathstr = path;
+ pathstr.append( *it );
+ Config config ( pathstr, Config::File );
config. setGroup ( "Colors" );
@@ -246,2 +264,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
gridLayout->addWidget( tempButton, 0, 1 );
+ QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) );
@@ -251,2 +270,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
gridLayout->addWidget( tempButton, 1, 1 );
+ QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) );
@@ -256,2 +276,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
gridLayout->addWidget( tempButton, 2, 1 );
+ QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) );
@@ -270,2 +291,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 );
+ QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) );
@@ -274,2 +296,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
lay-> addMultiCellWidget ( l, 1, 1, 0, 1 );
+ QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
@@ -290,2 +313,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 );
+ QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
@@ -298,2 +322,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
connect ( tb, SIGNAL( clicked ( )), this, SLOT( addExcept ( )));
+ QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) );
@@ -304,2 +329,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
connect ( tb, SIGNAL( clicked ( )), this, SLOT( delExcept ( )));
+ QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) );
@@ -310,2 +336,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
connect ( tb, SIGNAL( clicked ( )), this, SLOT( upExcept ( )));
+ QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) );
@@ -316,2 +343,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( )));
+ QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) );
@@ -343,2 +371,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
gridLayout-> addWidget ( label, 0, 0 );
+ QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
+
QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
@@ -354,2 +384,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
+ QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
@@ -358,2 +389,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
+ QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
@@ -362,2 +394,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
+ QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) );
@@ -374,3 +407,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
Appearance::Appearance( QWidget* parent, const char* name, WFlags )
- : QDialog ( parent, name, true )
+ : QDialog ( parent, name, true, WStyle_ContextHelp )
{
@@ -385,2 +418,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
m_sample-> setDecoration ( new DefaultWindowDecoration ( ));
+ QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
@@ -462,2 +496,3 @@ void Appearance::accept ( )
QStringList sl;
+ QString exceptstr;
for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) {
@@ -467,3 +502,5 @@ void Appearance::accept ( )
fl |= ( it-> noDeco ( ) ? 0x04 : 0 );
- sl << ( QString::number ( fl, 32 ) + it-> pattern ( ));
+ exceptstr = QString::number ( fl, 32 );
+ exceptstr.append( it-> pattern ( ));
+ sl << exceptstr;
}
@@ -612,3 +649,7 @@ void Appearance::saveSchemeClicked()
QString schemename = ed-> text ( );
- QFile file ( QPEApplication::qpeDir() + "/etc/colors/" + schemename + ".scheme" );
+ QString filestr = QPEApplication::qpeDir();
+ filestr.append( "/etc/colors/" );
+ filestr.append( schemename );
+ filestr.append( ".scheme" );
+ QFile file ( filestr );
if ( !file. exists ( ))
@@ -643,5 +684,9 @@ void Appearance::deleteSchemeClicked()
{
- if ( QMessageBox::warning ( this, tr( "Delete scheme" ), tr( "Do you really want to delete\n" ) + item-> text ( ) + "?",
- tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) {
- QFile::remove ( QPEApplication::qpeDir ( ) + "/etc/colors/" + item-> text ( ) + ".scheme" );
+ if ( QPEMessageBox::confirmDelete ( this, tr( "Delete scheme" ), item-> text ( ) ) )
+ {
+ QString filestr = QPEApplication::qpeDir ( );
+ filestr.append( "/etc/colors/" );
+ filestr.append( item-> text ( ) );
+ filestr.append( ".scheme" );
+ QFile::remove ( filestr );
delete item;
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp
index eefeccc..7e5225f 100644
--- a/noncore/settings/appearance2/editScheme.cpp
+++ b/noncore/settings/appearance2/editScheme.cpp
@@ -38,5 +38,6 @@
#include <qtoolbutton.h>
+#include <qwhatsthis.h>
-EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags fl )
- : QDialog ( parent, name, modal, fl )
+EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags )
+ : QDialog ( parent, name, modal, WStyle_ContextHelp )
{
@@ -53,2 +54,3 @@ EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget
layout-> addWidget ( l, i, 0 );
+ QWhatsThis::add( l, tr( "Click here to select a color for: " ).arg( labels [i] ) );
@@ -56,2 +58,3 @@ EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget
layout-> addWidget ( m_buttons [i], i, 1 );
+ QWhatsThis::add( m_buttons [i], tr( "Click here to select a color for: " ).arg( labels [i] ) );
}