Commit 27073cf3 authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

Put help buttons in all dialogs, linked to the online docs

svn path=/trunk/kdesdk/cervisia/; revision=163268
parent e0f1e427
......@@ -2,6 +2,8 @@
* Made editor configurable again
* Readded manpage
* Put help buttons in all dialogs, linked to
the online docs
2002-06-25 Bernd Gehrmann <bernd@mail.berlios.de>
......
......@@ -48,12 +48,16 @@ AnnotateDialog::AnnotateDialog(QWidget *parent, const char *name)
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton("&Help");
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
connect( buttonbox->addButton(i18n("&Close")), SIGNAL(clicked()),
SLOT(reject()) );
QPushButton *closebutton = buttonbox->addButton(i18n("&Close"));
buttonbox->layout();
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( closebutton, SIGNAL(clicked()), SLOT(reject()) );
QFontMetrics fm(fontMetrics());
setMinimumSize(fm.width("0123456789")*12,
fm.lineSpacing()*30);
......@@ -218,6 +222,12 @@ bool AnnotateDialog::parseCvsAnnotate(const QString &sandbox, const QString &rep
return true; // successful
}
void AnnotateDialog::helpClicked()
{
kapp->invokeHelp("annotate", "cervisia");
}
#include "annotatedlg.moc"
......
......@@ -34,9 +34,12 @@ public:
static void loadOptions(KConfig *config);
static void saveOptions(KConfig *config);
protected slots:
protected:
virtual void done(int res);
private slots:
void helpClicked();
private:
struct Options {
QSize size;
......
......@@ -149,16 +149,20 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton("&Help");
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *ok = buttonbox->addButton(i18n("OK"));
QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
ok->setDefault(true);
connect( ok, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
QPushButton *okbutton = buttonbox->addButton(i18n("OK"));
QPushButton *cancelbutton = buttonbox->addButton(i18n("Cancel"));
okbutton->setDefault(true);
buttonbox->layout();
buttonbox->setFixedHeight(buttonbox->height());
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( okbutton, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancelbutton, SIGNAL(clicked()), this, SLOT(reject()) );
layout->activate();
resize(sizeHint());
......@@ -322,6 +326,13 @@ void CheckoutDialog::moduleButtonClicked()
}
}
void CheckoutDialog::helpClicked()
{
QString anchor = (act==Import)? "importing" : "checkingout";
kapp->invokeHelp(anchor, "cervisia");
}
#include "checkoutdlg.moc"
......
......@@ -60,6 +60,7 @@ protected:
private slots:
void dirButtonClicked();
void moduleButtonClicked();
void helpClicked();
private:
struct Options {
......
......@@ -109,9 +109,10 @@ DiffDialog::DiffDialog(QWidget *parent, const char *name, bool modal)
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
connect( buttonbox->addButton(i18n("&Close")), SIGNAL(clicked()),
SLOT(reject()) );
QPushButton *closebutton = buttonbox->addButton(i18n("&Close"));
buttonbox->layout();
layout->addWidget(buttonbox, 0);
......@@ -119,6 +120,9 @@ DiffDialog::DiffDialog(QWidget *parent, const char *name, bool modal)
setMinimumSize(fm.width("0123456789")*12,
fm.lineSpacing()*30);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( closebutton, SIGNAL(clicked()), SLOT(reject()) );
if (options)
{
resize(options->size);
......@@ -555,8 +559,15 @@ void DiffDialog::forwClicked()
updateHighlight(newitem);
}
void DiffDialog::helpClicked()
{
kapp->invokeHelp("diff", "cervisia");
}
#include "diffdlg.moc"
// Local Variables:
// c-basic-offset: 4
// End:
......@@ -50,6 +50,7 @@ private slots:
void comboActivated(int index);
void backClicked();
void forwClicked();
void helpClicked();
private:
struct Options {
......
......@@ -104,10 +104,10 @@ HistoryDialog::HistoryDialog(QWidget *parent, const char *name)
layout->addWidget(listview, 1);
layout->addSpacing(10);
commit_box = new QCheckBox(i18n("Show &commit events"), this);
commit_box = new QCheckBox(i18n("Show c&ommit events"), this);
commit_box->setChecked(true);
commit_box->setMinimumSize(commit_box->sizeHint());
checkout_box = new QCheckBox(i18n("Show c&heckout events"), this);
checkout_box = new QCheckBox(i18n("Show ch&eckout events"), this);
checkout_box->setChecked(true);
checkout_box->setMinimumSize(checkout_box->sizeHint());
tag_box = new QCheckBox(i18n("Show &tag events"), this);
......@@ -185,14 +185,18 @@ HistoryDialog::HistoryDialog(QWidget *parent, const char *name)
layout->addSpacing(8);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *closebutton = buttonbox->addButton(i18n("&Close"));
closebutton->setAutoDefault(false);
connect( closebutton, SIGNAL(clicked()), SLOT(reject()) );
buttonbox->layout();
buttonbox->setFixedHeight(buttonbox->height());
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( closebutton, SIGNAL(clicked()), SLOT(reject()) );
if (options)
{
resize(options->size);
......@@ -279,6 +283,12 @@ void HistoryDialog::toggled(bool b)
}
void HistoryDialog::helpClicked()
{
kapp->invokeHelp("browsinghistory", "cervisia");
}
bool HistoryDialog::parseHistory(const QString &sandbox, const QString &repository)
{
setCaption(i18n("CVS History"));
......
......@@ -40,6 +40,7 @@ private slots:
virtual void done(int r);
void choiceChanged();
void toggled(bool b);
void helpClicked();
private:
struct Options {
......
......@@ -163,16 +163,22 @@ LogDialog::LogDialog(QWidget *parent, const char *name)
layout->addSpacing(8);
KButtonBox *buttonbox = new KButtonBox(this);
connect( buttonbox->addButton(i18n("&Diff")), SIGNAL(clicked()),
SLOT(diffClicked()) );
connect( buttonbox->addButton(i18n("&Annotate")), SIGNAL(clicked()),
SLOT(annotateClicked()) );
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *diffbutton = buttonbox->addButton(i18n("&Diff"));
diffbutton->setAutoDefault(false);
QPushButton *annotatebutton = buttonbox->addButton(i18n("&Annotate"));
annotatebutton->setAutoDefault(false);
connect( buttonbox->addButton(i18n("&Close")), SIGNAL(clicked()),
SLOT(reject()) );
buttonbox->layout();
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( diffbutton, SIGNAL(clicked()), SLOT(diffClicked()) );
connect( annotatebutton, SIGNAL(clicked()), SLOT(annotateClicked()) );
if (options)
{
resize(options->size);
......@@ -397,6 +403,12 @@ bool LogDialog::parseCvsLog(const QString &sbox, const QString &repo, const QStr
}
void LogDialog::helpClicked()
{
kapp->invokeHelp("browsinglogs", "cervisia");
}
void LogDialog::diffClicked()
{
if (selectionA.isEmpty() || selectionB.isEmpty())
......
......@@ -57,10 +57,11 @@ public:
static void loadOptions(KConfig *config);
static void saveOptions(KConfig *config);
protected slots:
protected:
virtual void done(int res);
private slots:
void helpClicked();
void diffClicked();
void annotateClicked();
void revisionSelected(QString rev, bool rmb);
......
......@@ -166,16 +166,20 @@ RepositoryDialog::RepositoryDialog(QWidget *parent, const char *name)
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *ok = buttonbox->addButton(i18n("OK"));
QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
ok->setDefault(true);
connect( ok, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
QPushButton *okbutton = buttonbox->addButton(i18n("OK"));
QPushButton *cancelbutton = buttonbox->addButton(i18n("Cancel"));
okbutton->setDefault(true);
buttonbox->layout();
buttonbox->setFixedHeight(buttonbox->height());
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( okbutton, SIGNAL(clicked()), SLOT(accept()) );
connect( cancelbutton, SIGNAL(clicked()), SLOT(reject()) );
layout->activate();
resize(sizeHint());
......@@ -353,6 +357,12 @@ void RepositoryDialog::slotLogoutClicked()
}
void RepositoryDialog::helpClicked()
{
kapp->invokeHelp("accessing-repository", "cervisia");
}
AddRepositoryDialog::AddRepositoryDialog(const QString &repo, QWidget *parent, const char *name)
: QDialog(parent, name, true)
{
......
......@@ -47,6 +47,7 @@ private slots:
void slotSettingsClicked();
void slotLoginClicked();
void slotLogoutClicked();
void helpClicked();
private:
struct Options {
......
......@@ -113,16 +113,22 @@ ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
connect( buttonbox->addButton(i18n("&Save")), SIGNAL(clicked()),
SLOT(slotSave()) );
connect( buttonbox->addButton(i18n("Sa&ve As...")), SIGNAL(clicked()),
SLOT(slotSaveAs()) );
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
connect( buttonbox->addButton(i18n("&Close")), SIGNAL(clicked()),
SLOT(accept()) );
QPushButton *savebutton = buttonbox->addButton(i18n("&Save"));
savebutton->setAutoDefault(false);
QPushButton *saveasbutton = buttonbox->addButton(i18n("Sa&ve As..."));
saveasbutton->setAutoDefault(false);
QPushButton *closebutton = buttonbox->addButton(i18n("&Close"));
buttonbox->layout();
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( savebutton, SIGNAL(clicked()), SLOT(saveClicked()) );
connect( saveasbutton, SIGNAL(clicked()), SLOT(slotSaveAs()) );
connect( closebutton, SIGNAL(clicked()), SLOT(accept()) );
setMinimumSize(fm.width("0123456789")*12,
fm.lineSpacing()*40);
layout->activate();
......@@ -495,13 +501,19 @@ void ResolveDialog::editClicked()
}
void ResolveDialog::slotSave()
void ResolveDialog::helpClicked()
{
kapp->invokeHelp("resolvingconflicts", "cervisia");
}
void ResolveDialog::saveClicked()
{
saveFile(fname);
}
void ResolveDialog::slotSaveAs()
void ResolveDialog::saveAsClicked()
{
QString filename =
KFileDialog::getSaveFileName(0, 0, this, 0);
......
......@@ -53,8 +53,9 @@ private slots:
void abClicked();
void baClicked();
void editClicked();
void slotSave();
void slotSaveAs();
void helpClicked();
void saveClicked();
void saveAsClicked();
private:
struct Options {
......
......@@ -58,7 +58,7 @@ void FontButton::chooseFont()
SettingsDialog::SettingsDialog( KConfig *conf, QWidget *parent, const char *name )
: KDialogBase(KDialogBase::Tabbed, i18n("Configure Cervisia"),
KDialogBase::Ok | KDialogBase::Cancel,
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
KDialogBase::Ok,
parent, name, true)
{
......@@ -157,6 +157,8 @@ SettingsDialog::SettingsDialog( KConfig *conf, QWidget *parent, const char *name
readSettings();
setHelp("customization", "cervisia");
#if 0
QGridLayout *editorlayout = new QGridLayout(editorgroup, 4, 2, 10, 6);
......
......@@ -84,12 +84,17 @@ TagDialog::TagDialog(ActionType action, const QString &sbox, const QString &repo
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *ok = buttonbox->addButton(i18n("OK"));
QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
ok->setDefault(true);
connect( ok, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
QPushButton *okbutton = buttonbox->addButton(i18n("OK"));
QPushButton *cancelbutton = buttonbox->addButton(i18n("Cancel"));
okbutton->setDefault(true);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( okbutton, SIGNAL(clicked()), SLOT(accept()) );
connect( cancelbutton, SIGNAL(clicked()), SLOT(reject()) );
buttonbox->layout();
layout->addWidget(buttonbox, 0);
......@@ -166,6 +171,12 @@ void TagDialog::tagButtonClicked()
tag_combo->insertItem(*it);
}
void TagDialog::helpClicked()
{
kapp->invokeHelp("taggingbranching", "cervisia");
}
#include "tagdlg.moc"
......
......@@ -43,6 +43,7 @@ protected:
private slots:
void tagButtonClicked();
void helpClicked();
private:
ActionType act;
......
......@@ -87,12 +87,17 @@ WatchDialog::WatchDialog(ActionType action, QWidget *parent, const char *name)
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
QPushButton *helpbutton = buttonbox->addButton(i18n("&Help"));
helpbutton->setAutoDefault(false);
buttonbox->addStretch();
QPushButton *ok = buttonbox->addButton(i18n("OK"));
QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
ok->setDefault(true);
connect( ok, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
QPushButton *okbutton = buttonbox->addButton(i18n("OK"));
QPushButton *cancelbutton = buttonbox->addButton(i18n("Cancel"));
okbutton->setDefault(true);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
connect( okbutton, SIGNAL(clicked()), SLOT(accept()) );
connect( cancelbutton, SIGNAL(clicked()), SLOT(reject()) );
buttonbox->layout();
layout->addWidget(buttonbox, 0);
......@@ -118,6 +123,12 @@ WatchDialog::Events WatchDialog::events()
return res;
}
void WatchDialog::helpClicked()
{
kapp->invokeHelp("watches", "cervisia");
}
#include "watchdlg.moc"
......
......@@ -33,6 +33,9 @@ public:
WatchDialog( ActionType action, QWidget *parent=0, const char *name=0 );
Events events();
private slots:
void helpClicked();
private:
QButtonGroup *group;
QRadioButton *all_button, *only_button;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment