add docs integration

This commit is contained in:
arcan1s 2014-08-10 11:05:29 +04:00
parent d44979e95e
commit 11db0fcf8d
23 changed files with 684 additions and 127 deletions

View File

@ -65,11 +65,9 @@ TODO (wish list)
----------------
* plasmoid helper integration
* gui helper|systemd integration
* helper uid/euid check to allow use /Ctrl interface
* `==` checking to avoid segfaults
* include security notes / project architecture to about window
* DBus API description
* tests
* autotests
Links
-----

View File

@ -5,6 +5,7 @@ message (STATUS "Subproject ${SUBPROJECT}")
# set directories
set (SUBPROJECT_BINARY_DIR bin)
set (SUBPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set (SUBPROJECT_DOCS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs)
set (SUBPROJECT_RESOURCE_DIR ${PROJECT_RESOURCE_DIR})
set (SUBPROJECT_TRANSLATION_DIR ${SUBPROJECT_RESOURCE_DIR}/translations)
# executable path
@ -15,6 +16,7 @@ set (TARGETS "")
set (HEADERS "")
add_subdirectory (${SUBPROJECT_SOURCE_DIR})
add_subdirectory (${SUBPROJECT_DOCS_DIR})
# build man
file (GLOB SUBPROJECT_MAN_IN *.1)
file (RELATIVE_PATH SUBPROJECT_MAN ${CMAKE_SOURCE_DIR} ${SUBPROJECT_MAN_IN})

View File

@ -0,0 +1,9 @@
# build pages
file (GLOB SUBPROJECT_DOCS_IN *.html)
foreach (DOC_IN ${SUBPROJECT_DOCS_IN})
file (RELATIVE_PATH ONE_DOC ${CMAKE_SOURCE_DIR} ${DOC_IN})
configure_file (${DOC_IN} ${CMAKE_CURRENT_BINARY_DIR}/${ONE_DOC})
set (SUBPROJECT_DOCS ${SUBPROJECT_DOCS} ${CMAKE_CURRENT_BINARY_DIR}/${ONE_DOC})
endforeach ()
install (FILES ${SUBPROJECT_DOCS} DESTINATION share/doc/${PROJECT_NAME})

View File

@ -0,0 +1,325 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>netctl-gui DBus API desription</title>
<style type="text/css">
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 5px 10px;
border: 1px solid #000000;
};
td {
text-align: justify;
}
th {
text-align: center;
}
th.sub {
font-style: italic;
font-weight: normal;
}
</style>
<h1>netctl-gui DBus API description</h1>
<h3>Project version : @PROJECT_VERSION@</h3>
<ol>
<li><a href="#api">DBus API</a></li>
<li><a href="#helper">Helper API</a></li>
<ul>
<li><a href="#ctrl">Helper ctrl API</a></li>
<li><a href="#netctl">Helper netctl API</a></li>
</ul>
<li><a href="#gui">GUI API</a></li>
<ul>
<li><a href="#netctlgui">GUI netctlgui API</a></li>
</ul>
<li><a href="#links">External links</a></li>
</ol>
</head>
<body>
<h2><a href="#api" class="anchor" name="api"></a>DBus API</h2>
<table>
<tbody><tr>
<th>method</th>
<th>responce</th>
<th>run as root</th>
</tr>
<!-- helper service -->
<tr>
<th colspan="3"><a href="#helper" class="anchor" name="helper"></a><code>org.netctlgui.helper</code> service (system bus)</th>
</tr>
<!-- /ctrl path -->
<tr>
<th colspan="3" class="sub"><a href="#ctrl" class="anchor" name="ctrl"></a><code>/ctrl</code> path</th>
</tr>
<!-- helper actions -->
<tr>
<td>bool Active()</td>
<td><code>true</code> if helper is active</td>
<td>no</td>
</tr>
<tr>
<td>QString ApiDocs()</td>
<td>returns path to this API documentation</td>
<td>no</td>
</tr>
<tr>
<td>bool Close()</td>
<td><code>true</code> and closes the helper</td>
<td>no</td>
</tr>
<tr>
<td>QString LibraryDocs()</td>
<td>returns path to the library documentation</td>
<td>no</td>
</tr>
<tr>
<td>QString SecurityDocs()</td>
<td>returns path to the security documentation</td>
<td>no</td>
</tr>
<tr>
<td>QStringList Settings()</td>
<td>current helper settings <code>KEY=VALUE</code></td>
<td>no</td>
</tr>
<tr>
<td>bool Update()</td>
<td>calls update helper configuration. Returns <code>true</code></td>
<td>no</td>
</tr>
<!-- netctl actions -->
<tr>
<td>bool Enable(QString profile)</td>
<td>enables or disables the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool Restart(QString profile)</td>
<td>restarts the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool Start(QString profile)</td>
<td>starts or stops the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool SwitchTo(QString profile)</td>
<td>switchs to the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool Create(QString profile, QStringList settingsList)</td>
<td>creates the profile with specified settings. Settings should be given in the format <code>KEY==VALUE</code>. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool Remove(QString profile)</td>
<td>removes the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<!-- netctl-auto actions -->
<tr>
<td>bool autoDisableAll()</td>
<td>disables all profiles (netctl-auto). Returns <code>true</code> if action has been performed successfully</td>
<td>no?</td>
</tr>
<tr>
<td>bool autoEnable(QString profile)</td>
<td>enables or disables the profile (netctl-auto). Returns <code>true</code> if action has been performed successfully</td>
<td>no?</td>
</tr>
<tr>
<td>bool autoEnableAll()</td>
<td>enables all profiles (netctl-auto). Returns <code>true</code> if action has been performed successfully</td>
<td>no?</td>
</tr>
<tr>
<td>bool autoStart(QString profile)</td>
<td>switchs to the profile (netctl-auto). Returns <code>true</code> if action has been performed successfully</td>
<td>no?</td>
</tr>
<!-- netctl-auto service actions -->
<tr>
<td>bool autoServiceEnable()</td>
<td>enables or disables netctl-auto systemd service. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool autoServiceRestart()</td>
<td>restarts netctl-auto systemd service. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool autoServiceStart()</td>
<td>starts or stops netctl-auto systemd service. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<!-- wpa_supplicant actions -->
<tr>
<td>QStringList WiFi()</td>
<td>returns available WiFi points in format <code>NAME|SECURITY|SIGNAL|ACTIVE|EXISTS</code></td>
<td>yes</td>
</tr>
<!-- /netctl path -->
<tr>
<th colspan="3" class="sub"><a href="#netctl" class="anchor" name="netctl"></a><code>/netctl</code> path</th>
</tr>
<!-- general information -->
<tr>
<td>QString ActiveProfile()</td>
<td>returns active profile from netctl or netctl-auto</td>
<td>no</td>
</tr>
<tr>
<td>QString ActiveProfileStatus()</td>
<td>returns active profile status from netctl or netctl-auto. May be <code>netctl-auto</code>, <code>active (enabled)</code>, <code>active (static)</code>, <code>inactive (enabled)</code>, <code>inactive (static)</code></td>
<td>no</td>
</tr>
<tr>
<td>QStringList Information()</td>
<td>returns general information in format <code>[ActiveProfile, ActiveProfileStatus]</code></td>
<td>no</td>
</tr>
<tr>
<td>QStringList ProfileList()</td>
<td>returns available profiles in format <code>NAME|DESCRIPTION|ACTIVE|ENABLED</code></td>
<td>no</td>
</tr>
<tr>
<td>QStringList WirelessInterface()</td>
<td>returns wireless interfaces</td>
<td>no</td>
</tr>
<!-- netctl specific information -->
<tr>
<td>bool isProfileActive(QString profile)</td>
<td>returns <code>true</code> if the profile is active</td>
<td>no</td>
</tr>
<tr>
<td>bool isProfileEnabled(QString profile)</td>
<td>returns <code>true</code> if the profile is enabled</td>
<td>no</td>
</tr>
<!-- netctl-auto specific information -->
<tr>
<td>bool autoIsProfileActive(QString profile)</td>
<td>returns <code>true</code> if the profile is active (netctl-auto)</td>
<td>no</td>
</tr>
<tr>
<td>bool autoIsProfileEnabled(QString profile)</td>
<td>returns <code>true</code> if the profile is enabled (netctl-auto)</td>
<td>no</td>
</tr>
<tr>
<td>bool isNetctlAutoActive()</td>
<td>returns <code>true</code> if netctl-auto is active</td>
<td>no</td>
</tr>
<tr>
<td>bool isNetctlAutoEnabled()</td>
<td>returns <code>true</code> if netctl-auto is enabled</td>
<td>no</td>
</tr>
<!-- profile information -->
<tr>
<td>QStringList Profile(QString profile)</td>
<td>returns the profile settings in format <code>KEY==VALUE</code></td>
<td>no</td>
</tr>
<tr>
<td>QString ProfileByEssid(QString essid)</td>
<td>returns the profile name by the given ESSID or empty line</td>
<td>no</td>
</tr>
<tr>
<td>QString ProfileValue(QString profile, QString key)</td>
<td>returns value of the key by the given profile or empty line</td>
<td>no</td>
</tr>
<!-- gui service -->
<tr>
<th colspan="3"><a href="#gui" class="anchor" name="gui"></a><code>org.netctlgui.netctlgui</code> service (session bus)</th>
</tr>
<!-- /netctlgui path -->
<tr>
<th colspan="3" class="sub"><a href="#netctlgui" class="anchor" name="netctlgui"></a><code>/netctlgui</code> path</th>
</tr>
<!-- gui actions -->
<tr>
<td>void ApiDocs()</td>
<td>opens this API documentation</td>
<td>no</td>
</tr>
<tr>
<td>bool Close()</td>
<td><code>true</code> and closes the application</td>
<td>no</td>
</tr>
<tr>
<td>QString Information()</td>
<td>the same as <code>org.netctlgui.helper /netctl Information</code></td>
<td>no</td>
</tr>
<tr>
<td>void LibraryDocs()</td>
<td>opens the library documentation</td>
<td>no</td>
</tr>
<tr>
<td>bool Restore()</td>
<td><code>true</code> and restores the application</td>
<td>no</td>
</tr>
<tr>
<td>void SecurityDocs()</td>
<td>opens the security documentation</td>
<td>no</td>
</tr>
<tr>
<td>QStringList Settings()</td>
<td>current application settings <code>KEY=VALUE</code></td>
<td>no</td>
</tr>
<tr>
<td>bool ShowAbout()</td>
<td><code>true</code> and shows about window</td>
<td>no</td>
</tr>
<tr>
<td>bool ShowMain()</td>
<td><code>true</code> and shows main window</td>
<td>no</td>
</tr>
<tr>
<td>bool ShowNetctlAuto()</td>
<td><code>true</code> and shows netctl-auto window</td>
<td>no</td>
</tr>
<tr>
<td>bool ShowSettings()</td>
<td><code>true</code> and shows settings window</td>
<td>no</td>
</tr>
</table>
<h2><a href="#links" class="anchor" name="links"></a>External links</h2>
<ul>
<li><a href="http://arcanis.name/projects/netctl-gui/">Homepage</a></li>
<li><a href="https://github.com/arcan1s/netctl-gui">Repository</a></li>
<li><a href="https://github.com/arcan1s/netctl-gui/issues">Bugtracker</a></li>
</ul>
<p align="center" style="font-size: 70%">
&copy; 2014-@CURRENT_YEAR@ <a href="mailto:@PROJECT_CONTACT@">@PROJECT_AUTHOR@</a><br>
This software is licensed under @PROJECT_LICENSE@
</p>
</body>
</html>

View File

@ -0,0 +1,29 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>netctl-gui secutiry notes</title>
<style type="text/css">
</style>
<h1>netctl-gui security notes</h1>
<h3>Project version : @PROJECT_VERSION@</h3>
<ol>
<li><a href="#links">External links</a></li>
</ol>
</head>
<body>
<h2><a href="#links" class="anchor" name="links"></a>External links</h2>
<ul>
<li><a href="http://arcanis.name/projects/netctl-gui/">Homepage</a></li>
<li><a href="https://github.com/arcan1s/netctl-gui">Repository</a></li>
<li><a href="https://github.com/arcan1s/netctl-gui/issues">Bugtracker</a></li>
</ul>
<p align="center" style="font-size: 70%">
&copy; 2014-@CURRENT_YEAR@ <a href="mailto:@PROJECT_CONTACT@">@PROJECT_AUTHOR@</a><br>
This software is licensed under @PROJECT_LICENSE@
</p>
</body>
</html>

View File

@ -63,7 +63,15 @@ show this help and exit
Configuration file
.RE
.SH SEE ALSO
.BR netctl-gui (1)
.BR netctlgui-helper (1)
.SH STANDARDS
See
.B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-dbus-api.html
for more details.
.SH SECURITY CONSIDERATIONS
See
.B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-security-notes.html
for more details.
.SH AUTHOR
@PROJECT_AUTHOR@ <\fI@PROJECT_CONTACT@\fR>
.SH LICENSE

View File

@ -6,80 +6,121 @@
<rect>
<x>0</x>
<y>0</y>
<width>388</width>
<height>288</height>
<width>452</width>
<height>361</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_description">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_version">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="spacer_about">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_links">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>324</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_name">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_version">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_description">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_translators">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_links">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="spacer_about">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="7" column="0">
<item>
<widget class="QLabel" name="label_license">
<property name="text">
<string/>
@ -90,6 +131,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
@ -98,13 +142,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_translators">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -79,13 +79,10 @@ void AboutWindow::createUi()
QWidget *aboutWidget = new QWidget();
uiAbout = new Ui::About;
uiAbout->setupUi(aboutWidget);
ui->verticalLayout->addWidget(aboutWidget);
ui->verticalLayout->insertWidget(0, aboutWidget);
createText();
QDialogButtonBox *buttonBox = new QDialogButtonBox;
buttonBox->addButton(QDialogButtonBox::Close);
ui->verticalLayout->addWidget(buttonBox);
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked(bool)), this, SLOT(close()));
connect(ui->buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked(bool)), this, SLOT(close()));
}

View File

@ -6,15 +6,23 @@
<rect>
<x>0</x>
<y>0</y>
<width>380</width>
<height>307</height>
<width>516</width>
<height>431</height>
</rect>
</property>
<property name="windowTitle">
<string>About</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"/>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>

View File

@ -117,6 +117,39 @@ void MainWindow::showSettingsWindow()
}
void MainWindow::showApi()
{
if (debug) qDebug() << "[MainWindow]" << "[showApi]";
if (QDesktopServices::openUrl(QUrl(QString(DOCS_PATH) + QString("netctl-gui-dbus-api.html"))))
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Error"));
}
void MainWindow::showLibrary()
{
if (debug) qDebug() << "[MainWindow]" << "[showLibrary]";
if (QDesktopServices::openUrl(QUrl(QString(DOCS_PATH) + QString("html/index.html"))))
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Error"));
}
void MainWindow::showSecurityNotes()
{
if (debug) qDebug() << "[MainWindow]" << "[showSecurityNotes]";
if (QDesktopServices::openUrl(QUrl(QString(DOCS_PATH) + QString("netctl-gui-security-notes.html"))))
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Error"));
}
bool MainWindow::forceStartHelper()
{
if (debug) qDebug() << "[MainWindow]" << "[forceStartHelper]";

View File

@ -243,9 +243,12 @@ void MainWindow::createActions()
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
connect(ui->actionAbout, SIGNAL(triggered(bool)), this, SLOT(showAboutWindow()));
connect(ui->actionApi, SIGNAL(triggered(bool)), this, SLOT(showApi()));
connect(ui->actionLibrary, SIGNAL(triggered(bool)), this, SLOT(showLibrary()));
connect(ui->actionNetctlAuto, SIGNAL(triggered(bool)), this, SLOT(showNetctlAutoWindow()));
connect(ui->actionSettings, SIGNAL(triggered(bool)), this, SLOT(showSettingsWindow()));
connect(ui->actionReport, SIGNAL(triggered(bool)), this, SLOT(reportABug()));
connect(ui->actionSecurity, SIGNAL(triggered(bool)), this, SLOT(showSecurityNotes()));
connect(ui->actionSettings, SIGNAL(triggered(bool)), this, SLOT(showSettingsWindow()));
connect(ui->actionQuit, SIGNAL(triggered(bool)), this, SLOT(closeMainWindow()));
// actions menu
@ -391,17 +394,6 @@ void MainWindow::deleteObjects()
}
void MainWindow::setIconsToTabs()
{
if (debug) qDebug() << "[MainWindow]" << "[setIconsToTabs]";
// tab widget
ui->tabWidget->setTabIcon(0, QIcon(":icon"));
ui->tabWidget->setTabIcon(1, QIcon::fromTheme("document-new"));
ui->tabWidget->setTabIcon(2, QIcon(":wifi"));
}
QMap<QString, QString> MainWindow::parseOptions(const QString options)
{
if (debug) qDebug() << "[MainWindow]" << "[parseOptions]";
@ -464,7 +456,6 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
// update ui
setTab(args[QString("tab")].toInt() - 1);
createActions();
setIconsToTabs();
// tray
if (isDaemon)

View File

@ -71,6 +71,10 @@ public slots:
void showMainWindow();
void showNetctlAutoWindow();
void showSettingsWindow();
// open docs
void showApi();
void showLibrary();
void showSecurityNotes();
// helper
bool forceStartHelper();
bool forceStopHelper();
@ -146,7 +150,6 @@ private:
void createObjects();
void deleteObjects();
void keyPressEvent(QKeyEvent *pressedKey);
void setIconsToTabs();
QString configPath;
bool debug = false;
bool hiddenNetwork;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<height>503</height>
<width>471</width>
<height>499</height>
</rect>
</property>
<property name="windowTitle">
@ -21,6 +21,10 @@
<number>0</number>
</property>
<widget class="QWidget" name="tab_main">
<attribute name="icon">
<iconset resource="../../resources/resources.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</attribute>
<attribute name="title">
<string>Connect to profile</string>
</attribute>
@ -105,7 +109,9 @@
<string>Refresh</string>
</property>
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
@ -137,7 +143,9 @@
<string>Restart</string>
</property>
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="autoDefault">
<bool>true</bool>
@ -153,7 +161,9 @@
<string>Start</string>
</property>
<property name="icon">
<iconset theme="system-run"/>
<iconset theme="system-run">
<normaloff/>
</iconset>
</property>
<property name="autoDefault">
<bool>true</bool>
@ -171,6 +181,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="icon">
<iconset theme="document-new"/>
</attribute>
<attribute name="title">
<string>Create a new profile</string>
</attribute>
@ -212,8 +225,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<height>345</height>
<width>439</width>
<height>340</height>
</rect>
</property>
<property name="sizePolicy">
@ -234,7 +247,9 @@
<string>Clear</string>
</property>
<property name="icon">
<iconset theme="edit-clear"/>
<iconset theme="edit-clear">
<normaloff/>
</iconset>
</property>
</widget>
</item>
@ -257,7 +272,9 @@
<string>Save</string>
</property>
<property name="icon">
<iconset theme="document-save"/>
<iconset theme="document-save">
<normaloff/>
</iconset>
</property>
</widget>
</item>
@ -266,6 +283,10 @@
</layout>
</widget>
<widget class="QWidget" name="tab_wifi">
<attribute name="icon">
<iconset resource="../../resources/resources.qrc">
<normaloff>:/wifi.png</normaloff>:/wifi.png</iconset>
</attribute>
<attribute name="title">
<string>Connect to Wi-Fi</string>
</attribute>
@ -342,7 +363,9 @@
<string>Refresh</string>
</property>
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
@ -374,7 +397,9 @@
<string>Start</string>
</property>
<property name="icon">
<iconset theme="system-run"/>
<iconset theme="system-run">
<normaloff/>
</iconset>
</property>
<property name="autoDefault">
<bool>true</bool>
@ -394,7 +419,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<width>471</width>
<height>22</height>
</rect>
</property>
@ -429,6 +454,10 @@
<property name="title">
<string>Help</string>
</property>
<addaction name="actionSecurity"/>
<addaction name="actionApi"/>
<addaction name="actionLibrary"/>
<addaction name="separator"/>
<addaction name="actionReport"/>
<addaction name="actionAbout"/>
</widget>
@ -608,6 +637,26 @@
<string>Report a bug</string>
</property>
</action>
<action name="actionApi">
<property name="text">
<string>DBus API reference</string>
</property>
</action>
<action name="actionSecurity">
<property name="icon">
<iconset theme="security-medium">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Security notes</string>
</property>
</action>
<action name="actionLibrary">
<property name="text">
<string>Library documentation</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
@ -622,6 +671,8 @@
<tabstop>pushButton_wifiRefresh</tabstop>
<tabstop>pushButton_wifiStart</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../../resources/resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -136,6 +136,12 @@ QString infoMessage()
infoMessage += QString("\tDBUS_HELPER_INTERFACE=%1\n").arg(QString(DBUS_HELPER_INTERFACE));
infoMessage += QString("\tDBUS_CTRL_PATH=%1\n").arg(QString(DBUS_CTRL_PATH));
infoMessage += QString("\tDBUS_LIB_PATH=%1\n").arg(QString(DBUS_LIB_PATH));
// docs path
infoMessage += QString("%1:\n").arg(QCoreApplication::translate("NetctlHelper", "Documentation"));
infoMessage += QString("\tDOCS_PATH=%1\n").arg(QString(DOCS_PATH));
QStringList docs = QDir(QString(DOCS_PATH)).entryList(QDir::NoDotAndDotDot);
for (int i=0; i<docs.count(); i++)
infoMessage += QString("\t%1\n").arg(docs[i]);
return infoMessage;
}

View File

@ -15,9 +15,9 @@
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "netctlguiadaptor.h"
#include "mainwindow.h"
#include "netctlguiadaptor.h"
NetctlGuiAdaptor::NetctlGuiAdaptor(MainWindow *parent)
@ -32,6 +32,12 @@ NetctlGuiAdaptor::~NetctlGuiAdaptor()
}
void NetctlGuiAdaptor::ApiDocs()
{
return mainWindow->showApi();
}
bool NetctlGuiAdaptor::Close()
{
mainWindow->closeMainWindow();
@ -45,6 +51,12 @@ QString NetctlGuiAdaptor::Information()
}
void NetctlGuiAdaptor::LibraryDocs()
{
return mainWindow->showLibrary();
}
bool NetctlGuiAdaptor::Restore()
{
mainWindow->show();
@ -52,6 +64,12 @@ bool NetctlGuiAdaptor::Restore()
}
void NetctlGuiAdaptor::SecurityDocs()
{
return mainWindow->showSecurityNotes();
}
QStringList NetctlGuiAdaptor::Settings()
{
return mainWindow->printSettings();

View File

@ -34,9 +34,12 @@ public:
~NetctlGuiAdaptor();
public slots:
void ApiDocs();
bool Close();
QString Information();
void LibraryDocs();
bool Restore();
void SecurityDocs();
QStringList Settings();
bool ShowAbout();
bool ShowMain();

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>654</width>
<height>315</height>
<width>686</width>
<height>403</height>
</rect>
</property>
<property name="windowTitle">
@ -136,8 +136,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>438</width>
<height>254</height>
<width>470</width>
<height>342</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@ -211,8 +211,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>438</width>
<height>254</height>
<width>470</width>
<height>342</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
@ -352,6 +352,12 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
@ -829,8 +835,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>438</width>
<height>254</height>
<width>436</width>
<height>252</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">

View File

@ -56,9 +56,13 @@ and edit copied file to avoid upgrade problems.
.SH SEE ALSO
.BR netctl-gui (1)
.SH STANDARDS
Some text will be here
See
.B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-dbus-api.html
for more details.
.SH SECURITY CONSIDERATIONS
Some text will be here.
See
.B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-security-notes.html
for more details.
.SH AUTHOR
@PROJECT_AUTHOR@ <\fI@PROJECT_CONTACT@\fR>
.SH LICENSE

View File

@ -18,6 +18,7 @@
#include "controladaptor.h"
#include "netctlhelper.h"
#include "version.h"
ControlAdaptor::ControlAdaptor(NetctlHelper *parent, const QMap<QString, QString> configuration)
@ -46,6 +47,12 @@ bool ControlAdaptor::Active()
}
QString ControlAdaptor::ApiDocs()
{
return (QString(DOCS_PATH) + QString("netctl-gui-dbus-api.html"));
}
bool ControlAdaptor::Close()
{
helper->quitHelper();
@ -53,6 +60,18 @@ bool ControlAdaptor::Close()
}
QString ControlAdaptor::LibraryDocs()
{
return (QString(DOCS_PATH) + QString("html/index.html"));
}
QString ControlAdaptor::SecurityDocs()
{
return (QString(DOCS_PATH) + QString("netctl-gui-security-notes.html"));
}
QStringList ControlAdaptor::Settings()
{
return helper->printSettings();

View File

@ -38,7 +38,10 @@ public:
public slots:
// helper
bool Active();
QString ApiDocs();
bool Close();
QString LibraryDocs();
QString SecurityDocs();
QStringList Settings();
bool Update();
// netctlCommand

View File

@ -95,6 +95,12 @@ QString infoMessage()
infoMessage += QString("\tDBUS_HELPER_INTERFACE=%1\n").arg(QString(DBUS_HELPER_INTERFACE));
infoMessage += QString("\tDBUS_CTRL_PATH=%1\n").arg(QString(DBUS_CTRL_PATH));
infoMessage += QString("\tDBUS_LIB_PATH=%1\n").arg(QString(DBUS_LIB_PATH));
// docs path
infoMessage += QString("%1:\n").arg(QCoreApplication::translate("NetctlHelper", "Documentation"));
infoMessage += QString("\tDOCS_PATH=%1\n").arg(QString(DOCS_PATH));
QStringList docs = QDir(QString(DOCS_PATH)).entryList(QDir::NoDotAndDotDot);
for (int i=0; i<docs.count(); i++)
infoMessage += QString("\t%1\n").arg(docs[i]);
return infoMessage;
}

View File

@ -15,4 +15,4 @@ install (FILES ${MAN_DIR}/Netctl.3 DESTINATION share/man/man3 RENAME ${SUBPROJEC
install (FILES ${MAN_DIR}/NetctlProfile.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_NetctlProfile.3)
install (FILES ${MAN_DIR}/WpaSup.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_WpaSup.3)
# html docs
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html DESTINATION share/doc/${SUBPROJECT})
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html DESTINATION share/doc/${PROJECT_NAME})

View File

@ -14,6 +14,7 @@
#define BUGTRACKER "https://github.com/arcan1s/netctl-gui/issues"
#define TRANSLATION "https://github.com/arcan1s/netctl-gui/issues/3"
#define AUR_PACKAGES "https://aur.archlinux.org/pkgbase/netctl-gui/"
#define DOCS_PATH "@CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/"
#define BUILD_DATE "@CURRENT_DATE@"
#define DATE "2014-@CURRENT_YEAR@"