Skip to content

Commit

Permalink
Help functionality added to wizards
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Feb 11, 2025
1 parent 9f175f9 commit c35f0ca
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/connection_canal.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- `Description`: Set a descriptive name. This value will be used to identify the connection in the treeview.
- `Path to driver`: Set the path to the CANAL driver to use. Click `set` to browse for the file. CANAL drivers are the same as `VSCP level I drivers`and on most Linux systems you can find them by default in the _/var/lib/vscp/drivers/level1/_ folder. Windows system usually have them in the folder _appdir/VSCP/drivers/level1. The exact location depends on the installation for the driver.
- `Device configuration string`: CANAL drivers are configured using a semicolon separated string. This string is deriver dependent. The exact format is described in the driver documentation. Some modern drivers have a wizard that can help you to construct this configuration string. Press `wizard` button to open this dialog.
- `Device configuration string`: CANAL drivers are configured using a semicolon separated string. This string is deriver dependent. The exact format is described in the driver documentation. Some modern drivers have a `wizard` that can help you to construct this configuration string. Press `wizard` button to open this dialog.
- `Device flags`: This is a bit mask that can be used to set some flags for the driver. The exact meaning of the bits is driver dependent. The driver documentation will tell you what the bits mean.
- `Datarate`: This is a device specific value for the communication rate. It is usually in bits per second but the exact meaning is driver dependent. The driver documentation will tell you what the value should be. In most cases you can leave this value to the default value zero.

Expand Down
11 changes: 8 additions & 3 deletions src/bootloaderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1566,8 +1566,13 @@ CBootLoadWizard::CBootLoadWizard(QWidget* parent, json* pconn)

setWindowTitle(tr("VSCP Works Bootloader Wizard"));

// Autosize
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(fitContents(int)));

// Connect help request with button
connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

// Connect F1 key to help
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::Key_F1), this, SLOT(showHelp()));
shortcut->setAutoRepeat(false);
}
Expand Down Expand Up @@ -1851,12 +1856,12 @@ CBootLoadWizard::showHelp(void)
QDesktopServices::openUrl(QUrl(link));
}


///////////////////////////////////////////////////////////////////////////////
// fitContents
//

void CBootLoadWizard::fitContents(int id)
void
CBootLoadWizard::fitContents(int id)
{
adjustSize(); // this automagically resizes the window to fit the contents
adjustSize(); // this automagically resizes the window to fit the contents
}
8 changes: 7 additions & 1 deletion src/canalconfigwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ CanalConfigWizard::CanalConfigWizard(QWidget* parent)

setWindowTitle(tr("VSCP level I (CANAL) driver configuration Wizard"));

// Size content
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(fitContents(int)));

// Connect help request with button
setOption(QWizard::HaveHelpButton);
connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

// Connect F1 key with help
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::Key_F1), this, SLOT(showHelp()));
shortcut->setAutoRepeat(false);
}
Expand Down Expand Up @@ -103,7 +109,7 @@ void CanalConfigWizard::fitContents(int id)
void
CanalConfigWizard::showHelp(void)
{
QString link = "https://grodansparadis.github.io/vscp-works-qt/#/bootload_window";
QString link = "https://grodansparadis.github.io/vscp-works-qt/#/connection_canal?id=config-wizard";
QDesktopServices::openUrl(QUrl(link));
}

Expand Down
6 changes: 4 additions & 2 deletions src/canalconfigwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ class CanalConfigWizard : public QWizard {
public:
CanalConfigWizard(QWidget* parent = nullptr);

/// Show help
void showHelp(void);


void accept() override;

private slots:

/// Fit window to content
void fitContents(int id);

/// Show help
void showHelp(void);
};

// ----------------------------------------------------------------------------
Expand Down

0 comments on commit c35f0ca

Please sign in to comment.