Commit e83c2309 authored by Arpan Patelia's avatar Arpan Patelia Committed by Carl Schwan
Browse files

Fixed broken links in Getting Started pages. Fixes issue #1...

Fixed broken links in Getting Started pages. Fixes issue #1 arpan/develop-kde-org#1.
parent 61cb2df4
......@@ -81,4 +81,4 @@ And launch it with:
Moving On
---------
Now you can move on to using [Creating the Main Window](main_window).
Now you can move on to using [Creating the Main Window](../main_window).
......@@ -7,7 +7,7 @@ description: >
## Summary
This tutorial carries on from [First Program Tutorial](hello_world) and will introduce the {{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} class.
This tutorial carries on from [First Program Tutorial](../hello_world) and will introduce the {{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} class.
In the previous tutorial, the program caused a dialog box to pop up but we're going to take steps towards a functioning application.
......@@ -66,4 +66,4 @@ mkdir build && cd build && cmake .. && make && ./mainwindow
Moving On
---------
Now you can move on to [Using Actions](using_actions).
Now you can move on to [Using Actions](../using_actions).
......@@ -35,7 +35,7 @@ We'll get into the details of mainwindow.cpp in a while.
### savingloadingui.rc
This is identical to usingactionsui.rc from the [previours tutorial](using_actions) except the name has changed to 'savingloading'. We do not need to add any information about any of the {{< api-link module="kconfigwidgets" link="KStandardAction" >}} since the placement of those actions is handled automatically by XMLGUI system.
This is identical to usingactionsui.rc from the [previous tutorial](../using_actions) except the name has changed to 'savingloading'. We do not need to add any information about any of the {{< api-link module="kconfigwidgets" link="KStandardAction" >}} since the placement of those actions is handled automatically by XMLGUI system.
## Explanation
......@@ -45,7 +45,7 @@ The first thing we do is add `fileName(QString())` to the MainWindow constructor
### Adding the actions
The first thing we are going to do is provide the outward interface for the user so they can tell the application to load and save. Like with the quit action in [previous tutorial](using_actions), we will use {{< api-link module="kconfigwidgets" link="KStandardAction" >}}. We add the actions in the same way as for the quit action and, for each one, we connect it to the appropriate slot that we declared in the header file.
The first thing we are going to do is provide the outward interface for the user so they can tell the application to load and save. Like with the quit action in [previous tutorial](../using_actions), we will use {{< api-link module="kconfigwidgets" link="KStandardAction" >}}. We add the actions in the same way as for the quit action and, for each one, we connect it to the appropriate slot that we declared in the header file.
### Creating a new document
......@@ -59,7 +59,7 @@ void MainWindow::newFile()
}
```
`fileName.clear()` sets the `fileName` QString to be empty to reflect the fact that this document does not yet have a presence on storage. `textArea->clear()` then clears the central text area using the same function that we connected the clear QAction to in [previous tutorial](using_actions).
`fileName.clear()` sets the `fileName` QString to be empty to reflect the fact that this document does not yet have a presence on storage. `textArea->clear()` then clears the central text area using the same function that we connected the clear QAction to in [previous tutorial](../using_actions).
{{< alert title="Warning" color="warning" >}}
This simple example simply clears the text area without checking if the file has been saved first. It's only meant as a demonstration of file I/O and not as an example of best programming practices.
......@@ -146,7 +146,7 @@ First we must ask the user for the name of the file they wish to open. We do thi
const QUrl fileNameFromDialog = QFileDialog::getOpenFileUrl(this, i18n("Open File"));
```
Here we use the QUrl class to handle files from remote locations.
Here we use the [QUrl](https://doc.qt.io/qt-5/qurl.html) class to handle files from remote locations.
Then we use the KIO library to retrieve our file. This allows us to open the file normally even if it's stored in a remote location like an FTP site. We make the following call to the {{< api-link module="kio" link="KIO::storedGet" >}} function with an argument for the file you wish to open or download:
......@@ -185,7 +185,7 @@ Again, for simplicity's sake, this tutorial only saves text files to local disk.
Since we are now using the KIO library, we must tell CMake to link against it. We do this by passing `KIO` to the `find_package()` function and `KF5::KIOCore` to `target_link_libraries()` function.
With this file, the tutorial can be built and run in the same way as the [previous tutorial](using_actions).
With this file, the tutorial can be built and run in the same way as the [previous tutorial](../using_actions).
```bash
mkdir build && cd build
......
......@@ -10,7 +10,7 @@ Introduction
This tutorial introduces the concept of actions. Actions are a unified way of supplying the user with ways to interact with your program.
For example, if we wanted to let the user of your [window](main_window) clear the text box by clicking a button in the toolbar, from an option in the File menu or through a keyboard shortcut, it could all be done with one [QAction](https://doc.qt.io/qt-5/qaction.html).
For example, if we wanted to let the user of your [window](../main_window) clear the text box by clicking a button in the toolbar, from an option in the File menu or through a keyboard shortcut, it could all be done with one [QAction](https://doc.qt.io/qt-5/qaction.html).
![](result.png)
......@@ -112,7 +112,7 @@ They are very simple to use. Once the library has been included (`#include <KSta
KStandardAction::quit(qApp, &QCoreApplication::quit, actionCollection());
```
Here we call the QApplicaton's [quit ](https://doc.qt.io/qt-5/qapplication.html#quit) method whenever the :kconfigwidgetsapi:`KStandardAction` quit is triggered. We are able to access that QApplication method via the [qApp](https://doc.qt.io/qt-5/qapplication.html#qApp>) macro.
Here we call the QApplicaton's [quit ](https://doc.qt.io/qt-5/qapplication.html#quit) method whenever the :kconfigwidgetsapi:`KStandardAction` quit is triggered. We are able to access that QApplication method via the [qApp](https://doc.qt.io/qt-5/qapplication.html#qApp) macro.
In the end, this creates a QAction with the correct icon, text and shortcut and even adds it to the File menu.
......@@ -160,7 +160,7 @@ Finally, the `texteditorui.rc` needs to go somewhere where the system can find i
:language: cmake
:linenos:
This file is almost identical to the one for :doc`previous tutorial<main_window>`, but with two extra lines at the end that describe where the files are to be installed. Firstly, the `texteditor` target is installed to the `KDE_INSTALL_TARGETS_DEFAULT_ARGS` then the `texteditorui.rc` file that describes the layout of the user interface is installed to the application's data directory under `KDE_INSTALL_KXMLGUI5DIR`.
This file is almost identical to the one for [previous tutorial](../main_window), but with two extra lines at the end that describe where the files are to be installed. Firstly, the `texteditor` target is installed to the `KDE_INSTALL_TARGETS_DEFAULT_ARGS` then the `texteditorui.rc` file that describes the layout of the user interface is installed to the application's data directory under `KDE_INSTALL_KXMLGUI5DIR`.
## Make, Install And Run
......
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