[rkward-cvs] rkward/rkward helpdlg.ui,NONE,1.1 khelpdlg.cpp,NONE,1.1 khelpdlg.h,NONE,1.1 rkhelpdock.cpp,NONE,1.1 rkhelpdock.h,NONE,1.1 Makefile.am,1.49,1.50 rkward.cpp,1.57,1.58 rkward.h,1.26,1.27
Pierre
ecoch at users.sourceforge.net
Fri Feb 25 22:28:28 UTC 2005
Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3581
Modified Files:
Makefile.am rkward.cpp rkward.h
Added Files:
helpdlg.ui khelpdlg.cpp khelpdlg.h rkhelpdock.cpp rkhelpdock.h
Log Message:
Adding help dock.
--- NEW FILE: khelpdlg.cpp ---
/***************************************************************************
rkward.h - description
-------------------
begin : Tue Oct 29 20:06:08 CET 2002
copyright : (C) 2002 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <klocale.h>
#include "kurl.h"
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlistview.h>
#include "rbackend/rinterface.h"
#include "debug.h"
#include "rkglobals.h"
#include "rkward.h"
#include "khelpdlg.h"
#define GET_HELP_URL 1
#define HELP_SEARCH 2
KHelpDlg::KHelpDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
: helpDlg(parent,name, modal,fl)
{
resultsList->clear();
// HACK : I should'nt have to do that.
resultsList->removeColumn(0);
resultsList->addColumn (i18n ("Topic"));
resultsList->addColumn (i18n ("Title"));
resultsList->addColumn (i18n ("Package"));
}
KHelpDlg::~KHelpDlg()
{}
/*$SPECIALIZATION$*/
void KHelpDlg::slotFindButtonClicked()
{
QString agrep = "FALSE";
QString ignoreCase = "TRUE";
if(fuzzyCheckBox->isChecked ()==TRUE){
agrep="NULL";
}
if(caseSensitiveCheckBox->isChecked ()==TRUE){
ignoreCase="FALSE";
}
QString s = ".rk.get.search.results(\"";
s.append(field->currentText());
s.append("\",agrep=");
s.append(agrep);
s.append(", ignore.case=");
s.append(ignoreCase);
s.append(")");
RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, "", this, HELP_SEARCH, chain);
}
void KHelpDlg::slotResultsListDblClicked( QListViewItem * item, const QPoint &, int )
{
chain=0;
QString s="help(\"";
s.append(item->text(0));
s.append("\", htmlhelp=TRUE, package= \"");
s.append(item->text(2));
s.append("\")");
RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, "", this, GET_HELP_URL, chain);
}
void KHelpDlg::rCommandDone (RCommand *command) {
KURL url;
if (command->getFlags () == HELP_SEARCH) {
resultsList->clear();
RK_ASSERT ((command->stringVectorLength () % 3) == 0);
int count = (command->stringVectorLength () / 3);
for (int i=0; i < count; ++i) {
new QListViewItem (resultsList, command->getStringVector ()[i], command->getStringVector ()[count + i], command->getStringVector ()[2*count + i]);
}
}
else if (command->getFlags () == GET_HELP_URL) {
url.setPath(command->getStringVector ()[0]);
if (QFile::exists( url.path() )) {
RKGlobals::rkApp()->openHTML(url);
return;
}
} else {
RK_ASSERT (false);
}
}
#include "khelpdlg.moc"
Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** rkward.h 25 Feb 2005 15:46:01 -0000 1.26
--- rkward.h 25 Feb 2005 22:28:26 -0000 1.27
***************
*** 48,51 ****
--- 48,52 ----
class RKDocManager;
class RKCommandEditorWindow;
+ class KHelpDlg;
/**
***************
*** 271,274 ****
--- 272,276 ----
RKOutputWindow *output;
RObjectBrowser *object_browser;
+ KHelpDlg *helpDlg;
KURL *initial_url;
--- NEW FILE: helpdlg.ui ---
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>helpDlg</class>
<widget class="QDialog">
<property name="name">
<cstring>helpDlg</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>276</height>
</rect>
</property>
<property name="caption">
<string>Help search</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout28</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout27</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout26</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout25</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QSplitter">
<property name="name">
<cstring>splitter3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Find:</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>field</cstring>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>findButton</cstring>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Find</string>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout21</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Fields:</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>fieldsList</cstring>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel3</cstring>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Packages:</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>packagesList</cstring>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>caseSensitiveCheckBox</cstring>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Case sensitive</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>fuzzyCheckBox</cstring>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Fuzzy matching</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</vbox>
</widget>
</hbox>
</widget>
<widget class="QListView">
<column>
<property name="text">
<string>Column 1</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<item>
<property name="text">
<string>New Item</string>
</property>
<property name="pixmap">
<pixmap></pixmap>
</property>
</item>
<property name="name">
<cstring>resultsList</cstring>
</property>
</widget>
</vbox>
</widget>
</grid>
</widget>
<connections>
<connection>
<sender>findButton</sender>
<signal>clicked()</signal>
<receiver>helpDlg</receiver>
<slot>slotFindButtonClicked()</slot>
</connection>
<connection>
<sender>resultsList</sender>
<signal>doubleClicked(QListViewItem*,const QPoint&,int)</signal>
<receiver>helpDlg</receiver>
<slot>slotResultsListDblClicked(QListViewItem*,const QPoint&,int)</slot>
</connection>
</connections>
<includes>
<include location="local" impldecl="in implementation">helpdlg.ui.h</include>
</includes>
<slots>
<slot>slotFindButtonClicked()</slot>
<slot>slotResultsListDblClicked( QListViewItem *, const QPoint &, int )</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
</UI>
--- NEW FILE: rkhelpdock.h ---
/***************************************************************************
rkward.h - description
-------------------
begin : Tue Oct 29 20:06:08 CET 2002
copyright : (C) 2002 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef RKHELPDOCK_H
#define RKHELPDOCK_H
#include <qwidget.h>
/**
@author Thomas Friedrichsmeier
*/
class RKHelpDock : public QWidget
{
Q_OBJECT
public:
RKHelpDock(QWidget *parent = 0, const char *name = 0);
~RKHelpDock();
private:
QBoxLayout* pLayout;
//KHelpDlg dlg;
};
#endif
Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/Makefile.am,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** Makefile.am 25 Feb 2005 14:44:41 -0000 1.49
--- Makefile.am 25 Feb 2005 22:28:26 -0000 1.50
***************
*** 4,8 ****
## INCLUDES were found outside kdevelop specific part
! rkward_SOURCES = rkwatch.cpp rkward.cpp main.cpp rkoutputwindow.cpp rkcommandeditor.cpp rkglobals.cpp robjectbrowser.cpp rkeditormanager.cpp robjectviewer.cpp
rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \
$(top_builddir)/rkward/agents/libagents.a $(top_builddir)/rkward/dialogs/libdialogs.a \
--- 4,10 ----
## INCLUDES were found outside kdevelop specific part
! rkward_SOURCES = rkwatch.cpp rkward.cpp main.cpp rkoutputwindow.cpp \
! rkcommandeditor.cpp rkglobals.cpp robjectbrowser.cpp rkeditormanager.cpp robjectviewer.cpp \
! helpdlg.ui khelpdlg.cpp rkhelpdock.cpp
rkward_LDADD = $(top_builddir)/rkward/windows/libwindows.a \
$(top_builddir)/rkward/agents/libagents.a $(top_builddir)/rkward/dialogs/libdialogs.a \
***************
*** 69,73 ****
fi
! noinst_HEADERS = debug.h rkcommandeditor.h rkglobals.h robjectbrowser.h rkeditormanager.h robjectviewer.h
phpfilesdir = $(kde_datadir)/rkward/phpfiles
--- 71,76 ----
fi
! noinst_HEADERS = debug.h rkcommandeditor.h rkglobals.h robjectbrowser.h \
! rkeditormanager.h robjectviewer.h khelpdlg.h rkhelpdock.h
phpfilesdir = $(kde_datadir)/rkward/phpfiles
Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** rkward.cpp 25 Feb 2005 15:46:01 -0000 1.57
--- rkward.cpp 25 Feb 2005 22:28:26 -0000 1.58
***************
*** 75,78 ****
--- 75,79 ----
#include "windows/rkcommandeditorwindow.h"
#include "windows/rkhelpwindow.h"
+ #include "khelpdlg.h"
#include "debug.h"
***************
*** 112,116 ****
RKGlobals::manager = new RKEditorManager ();
! KMdiChildView * editorManagerView = createWrapper(RKGlobals::editorManager (), i18n( "Editor"), i18n( "Editor"));
editorManagerView->setIcon(SmallIcon("spreadsheet"));
addWindow( editorManagerView );
--- 113,117 ----
RKGlobals::manager = new RKEditorManager ();
! KMdiChildView * editorManagerView = createWrapper(RKGlobals::editorManager (), i18n( "Data editor"), i18n( "Data editor"));
editorManagerView->setIcon(SmallIcon("spreadsheet"));
addWindow( editorManagerView );
***************
*** 201,204 ****
--- 202,209 ----
+ helpDlg = new KHelpDlg(0);
+ addToolWindow(helpDlg,KDockWidget::DockBottom, getMainDockWidget(), 10);
+
+
// just to initialize the window-actions according to whether they're shown on startup or not
slotToggleWindowClosed ();
--- NEW FILE: rkhelpdock.cpp ---
/***************************************************************************
rkward.h - description
-------------------
begin : Tue Oct 29 20:06:08 CET 2002
copyright : (C) 2002 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <qlayout.h>
#include "khelpdlg.h"
#include "rkhelpdock.h"
RKHelpDock::RKHelpDock(QWidget *parent, const char *name)
: QWidget(parent, name)
{
/*dlg = new KHelpDlg();
pLayout = new QHBoxLayout( this, 0, -1, "layout");
pLayout->addWidget(dlg);*/
}
RKHelpDock::~RKHelpDock()
{
}
#include "rkhelpdock.moc"
--- NEW FILE: khelpdlg.h ---
/***************************************************************************
rkward.h - description
-------------------
begin : Tue Oct 29 20:06:08 CET 2002
copyright : (C) 2002 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef KHELPDLG_H
#define KHELPDLG_H
#include "rbackend/rcommandreceiver.h"
#include "helpdlg.h"
class RCommandChain;
class KHelpDlg : public helpDlg, public RCommandReceiver
{
Q_OBJECT
public:
KHelpDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~KHelpDlg();
void rCommandDone (RCommand *command);
/*$PUBLIC_FUNCTIONS$*/
public slots:
/*$PUBLIC_SLOTS$*/
virtual void slotFindButtonClicked();
virtual void slotResultsListDblClicked( QListViewItem *item, const QPoint &, int );
protected:
/*$PROTECTED_FUNCTIONS$*/
protected slots:
/*$PROTECTED_SLOTS$*/
private:
RCommandChain *chain;
};
#endif
More information about the rkward-tracker
mailing list