Author: coolo
Date: Wed Dec 19 15:04:59 2007
New Revision: 43188
URL: http://svn.opensuse.org/viewcvs/yast?rev=43188&view=rev
Log:
adding a search function to the help popup and
a F1 shortcut to it
Added:
trunk/qt/src/QY2HelpDialog.cc
trunk/qt/src/QY2HelpDialog.h
trunk/qt/src/pkg/icons/viewmag.xpm
Modified:
trunk/qt/src/CMakeLists.txt
trunk/qt/src/QHelpDialog.ui
trunk/qt/src/YQWizard.cc
Modified: trunk/qt/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/CMakeLists.txt?rev=43188&r1=43187&r2=43188&view=diff
==============================================================================
--- trunk/qt/src/CMakeLists.txt (original)
+++ trunk/qt/src/CMakeLists.txt Wed Dec 19 15:04:59 2007
@@ -15,6 +15,7 @@
QY2CharValidator.cc
QY2ComboTabWidget.cc
QY2DiskUsageList.cc
+ QY2HelpDialog.cc
QY2ListView.cc
QY2Settings.cc
QY2Styler.cc
Modified: trunk/qt/src/QHelpDialog.ui
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QHelpDialog.ui?rev=43188&r1=43187&r2=43188&view=diff
==============================================================================
--- trunk/qt/src/QHelpDialog.ui (original)
+++ trunk/qt/src/QHelpDialog.ui Wed Dec 19 15:04:59 2007
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>400</width>
- <height>300</height>
+ <width>581</width>
+ <height>388</height>
</rect>
</property>
<property name="windowTitle" >
@@ -21,6 +21,16 @@
<item>
<layout class="QHBoxLayout" >
<item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ <item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@@ -36,7 +46,7 @@
<item>
<widget class="QPushButton" name="pushButton" >
<property name="text" >
- <string>Close</string>
+ <string>&Close</string>
</property>
</widget>
</item>
Added: trunk/qt/src/QY2HelpDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2HelpDialog.cc?rev=43188&view=auto
==============================================================================
--- trunk/qt/src/QY2HelpDialog.cc (added)
+++ trunk/qt/src/QY2HelpDialog.cc Wed Dec 19 15:04:59 2007
@@ -0,0 +1,50 @@
+#include
+#include "ui_QHelpDialog.h"
+#include <QDebug>
+#include <QTextObject>
+
+#include "pkg/icons/viewmag.xpm"
+
+QY2HelpDialog::QY2HelpDialog( const QString& helpText, QWidget *parent )
+ : QDialog( parent )
+{
+ _ui = new Ui_QHelpDialog();
+ _ui->setupUi( this );
+ _ui->textBrowser->setText( helpText );
+
+ _ui->label->setPixmap ( QPixmap( viewmag ) );
+ connect( _ui->lineEdit, SIGNAL( textEdited( QString ) ),
+ SLOT( searchStringChanged( QString ) ) );
+
+ _ui->lineEdit->setFocus( Qt::OtherFocusReason );
+}
+
+QY2HelpDialog::~QY2HelpDialog()
+{
+ delete _ui;
+}
+
+void QY2HelpDialog::searchStringChanged( QString text )
+{
+ QTextCharFormat fmt;
+ fmt.setBackground( Qt::yellow );
+ QTextDocument *d = _ui->textBrowser->document();
+
+ for ( QList<QTextCursor>::iterator it = _marks.begin(); it != _marks.end(); ++it )
+ ( *it ).setCharFormat( QTextCharFormat() );
+ _marks.clear();
+
+ QTextCursor c( d );
+
+ while ( true )
+ {
+ c = d->find( text, c );
+ if ( c.isNull() )
+ break;
+ c.setCharFormat( fmt );
+ c.select( QTextCursor::WordUnderCursor );
+ _marks.push_back( c );
+ }
+}
+
+#include "QY2HelpDialog.moc"
Added: trunk/qt/src/QY2HelpDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2HelpDialog.h?rev=43188&view=auto
==============================================================================
--- trunk/qt/src/QY2HelpDialog.h (added)
+++ trunk/qt/src/QY2HelpDialog.h Wed Dec 19 15:04:59 2007
@@ -0,0 +1,26 @@
+#ifndef _QY2HelpDialog_h
+#define _QY2HelpDialog_h
+
+#include <QDialog>
+
+class QTextCursor;
+class Ui_QHelpDialog;
+
+class QY2HelpDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ QY2HelpDialog( const QString &helpText, QWidget *parent );
+ ~QY2HelpDialog();
+
+public slots:
+ void searchStringChanged( QString );
+
+private:
+ Ui_QHelpDialog *_ui;
+ QList<QTextCursor> _marks;
+};
+
+#endif
+
Modified: trunk/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.cc?rev=43188&r1=43187&r2=43188&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.cc (original)
+++ trunk/qt/src/YQWizard.cc Wed Dec 19 15:04:59 2007
@@ -31,7 +31,6 @@
#include <QSvgRenderer>
#include <QPainter>
#include <QStackedWidget>
-#include "ui_QHelpDialog.h"
#include
#include
#include
@@ -46,6 +45,7 @@
#include "QY2ListView.h"
#include "QY2Styler.h"
+#include "QY2HelpDialog.h"
#include <QGridLayout>
#include
@@ -686,6 +686,7 @@
// Help button - intentionally without keyboard shortcut
_helpButton = new QPushButton( _( "Help" ), parent );
YUI_CHECK_NEW( _helpButton );
+ _helpButton->setShortcut( Qt::Key_F1 );
connect( _helpButton, SIGNAL( clicked() ),
this, SLOT ( showHelp() ) );
@@ -865,10 +866,7 @@
void YQWizard::showHelp()
{
- QDialog helpDlg( this );
- Ui_QHelpDialog ui;
- ui.setupUi( &helpDlg );
- ui.textBrowser->setText( _qHelpText );
+ QY2HelpDialog helpDlg( _qHelpText, this );
helpDlg.exec();
}
Added: trunk/qt/src/pkg/icons/viewmag.xpm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/icons/viewmag.xpm?rev=43188&view=auto
==============================================================================
--- trunk/qt/src/pkg/icons/viewmag.xpm (added)
+++ trunk/qt/src/pkg/icons/viewmag.xpm Wed Dec 19 15:04:59 2007
@@ -0,0 +1,133 @@
+/* XPM */
+static const char *viewmag[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 111 2",
+" c #7A4D27",
+". c #61596B",
+"X c #6E6F7D",
+"o c #874D18",
+"O c #A05A13",
+"+ c #AF6816",
+"@ c #BD7116",
+"# c #855427",
+"$ c #94622D",
+"% c #A36E2C",
+"& c #815C41",
+"* c #81624C",
+"= c #AD7E4A",
+"- c #D5902D",
+"; c #D7902C",
+": c #D8912B",
+"> c #DF9A33",
+", c #D1A65A",
+"< c #D7AE63",
+"1 c #D2B16D",
+"2 c #D1B16E",
+"3 c #DAB66D",
+"4 c #F3CC77",
+"5 c #F5D07A",
+"6 c #F5D07B",
+"7 c #707482",
+"8 c #887D81",
+"9 c #7F8188",
+"0 c #7E8289",
+"q c #83848A",
+"w c #86898D",
+"e c #998C8D",
+"r c #838993",
+"t c #8C8D91",
+"y c #8C8C94",
+"u c #8E8F97",
+"i c #888898",
+"p c #89909A",
+"a c #8E939D",
+"s c #8E929F",
+"d c #8E949D",
+"f c #929499",
+"g c #91979E",
+"h c #A0A8B2",
+"j c #A6AEB7",
+"k c #AAAEB8",
+"l c #ACB0B6",
+"z c #AEB2B9",
+"x c #ACB3BB",
+"c c #AFB5BB",
+"v c #B0B6BB",
+"b c #B1B6BC",
+"n c #B1BAC1",
+"m c #B4BDC3",
+"M c #B4BEC4",
+"N c #B9C3C9",
+"B c #BBC5CA",
+"V c #BEC6CB",
+"C c #BDC7CC",
+"Z c #BEC8CD",
+"A c #BFC8CE",
+"S c #BFC9CE",
+"D c #C6C8C9",
+"F c #C4CACC",
+"G c #C3CCCE",
+"H c #C2CCD0",
+"J c #C3CDD0",
+"K c #C4CED2",
+"L c #C5CED3",
+"P c #C6CFD3",
+"I c #C7D1D5",
+"U c #C8D1D4",
+"Y c #C9D3D7",
+"T c #CBD4D7",
+"R c #CCD6D9",
+"E c #CDD7DA",
+"W c #CED8DA",
+"Q c #D1D5D5",
+"! c #D0D9DB",
+"~ c #D1DBDC",
+"^ c #D2DBDC",
+"/ c #D2DADD",
+"( c #D5DDDF",
+") c #D5DEDF",
+"_ c #D6DEE0",
+"` c #D6DFE0",
+"' c #D7E0E2",
+"] c #D8E1E2",
+"[ c #D9E2E3",
+"{ c #DAE2E2",
+"} c #DBE2E3",
+"| c #DDE5E5",
+" . c #DEE6E7",
+".. c #DFE7E7",
+"X. c #E1E1E2",
+"o. c #E0E7E8",
+"O. c #E0E8E8",
+"+. c #E1E8E9",
+"@. c #E2EAEA",
+"#. c #E3EAEA",
+"$. c #E6EAEA",
+"%. c #E6ECEC",
+"&. c #E7EDED",
+"*. c #E8EDED",
+"=. c #EBF0F0",
+"-. c #ECF0F1",
+";. c #EDF1F1",
+":. c #F0F4F4",
+">. c #F3F6F6",
+",. c #F8F9F9",
+"<. c None",
+/* pixels */
+"<.<.<.k x c b z <.<.<.<.<.<.<.<.",
+"<.<.j M C S A V v <.<.<.<.<.<.<.",
+"<.h N T ^ R K I U l <.<.<.<.<.<.",
+"s n Y ..*./ ` ~ ) F <.<.<.<.<.<.",
+"a B ! &.-._ o.| .{ f <.<.<.<.<.",
+"g Z P E ( +.&.%.*.%.t <.<.<.<.<.",
+"r S L ! } %.*.;.:.$.q <.<.<.<.<.",
+"7 m H R [ #.=.>.,.D <.<.<.<.<.<.",
+"<.p J W ] @.=.>.X.y <.<.<.<.<.<.",
+"<.<.d G ' O.*.Q u i e <.<.<.<.<.",
+"<.<.<.0 0 w 9 X <.8 = ; @ <.<.<.",
+"<.<.<.<.<.<.<.<.<.<., 6 > + <.<.",
+"<.<.<.<.<.<.<.<.<.<.% 3 5 : O <.",
+"<.<.<.<.<.<.<.<.<.<.<.$ 1 4 - o ",
+"<.<.<.<.<.<.<.<.<.<.<.<.# 2 < & ",
+"<.<.<.<.<.<.<.<.<.<.<.<.<. * . "
+};
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org