Permalink
Browse files

Issue #144

  • Loading branch information...
1 parent 5abb683 commit c686c51842177313bca9f90d50c346c08fa9ca7d @Gudini Gudini committed Apr 8, 2012
@@ -0,0 +1,44 @@
+#include "guidedialog.h"
+#include <QtGui>
+#include <QSettings>
+#include "config.h"
+
+GuideDialog::GuideDialog(QWidget *parent) :
+ QDialog(parent)
+{
+ QPushButton *mButtonOk = new QPushButton("OK");
+ QString mStringText = QString::fromLocal8Bit("<table><tr valign=\"middle\"><td align=\"left\"><img src=\"%1\"></td>"
+ "<td><font color=\"blue\"><b>Knowledge Base source Editor</b></font> is an application,<br>"
+ "that aims to assist in creating and editing snippets of knowledge bases of intelligent systems"
+ "the design is based on technology OSTIS(<font color=\"blue\">http://www.ostis.net</b></font>)"
+ "îñíîâàíî íà òåõíîëîãèè OSTIS."
+ "The basis of the editor of the principle of visualization of the data stored in the knowledge base,"
+ "which greatly simplifies the process of editing and speeds up the process of designing a knowledge base.</td></tr></table>")
+ .arg(QFileInfo(Config::pathIcons, "help-about-logo.png").absoluteFilePath());
+ QTextBrowser *mTextBrowser = new QTextBrowser();
+ mTextBrowser->setText(mStringText);
+ QPushButton *mButtonCancel = new QPushButton("Cancel");
+ mCheckBox = new QCheckBox("Don't show this again next time");
+ QVBoxLayout *mVLayout = new QVBoxLayout();
+ QHBoxLayout *mHLayout = new QHBoxLayout();
+ mHLayout->addWidget(mButtonOk);
+ mHLayout->addWidget(mButtonCancel);
+ mVLayout->addWidget(mTextBrowser);
+ mVLayout->addWidget(mCheckBox);
+ mVLayout->addLayout(mHLayout);
+ this->setLayout(mVLayout);
+ setWindowTitle("Start Guide");
+ connect(mButtonOk,SIGNAL(clicked()),this,SLOT(setSetting()));
+ connect(mButtonCancel,SIGNAL(clicked()),this,SLOT(close()));
+ QSettings settings;
+ if (settings.value("dontShowWindowOnStart").toBool())
+ mCheckBox->setChecked(true);
+ resize(420,300);
+}
+
+void GuideDialog::setSetting()
+{
+ QSettings *settings = new QSettings();
+ settings->setValue("dontShowWindowOnStart",mCheckBox->isChecked());
+ close();
+}
View
@@ -0,0 +1,20 @@
+#ifndef GUIDEDIALOG_H
+#define GUIDEDIALOG_H
+
+#include <QDialog>
+#include <QCheckBox>
+
+class GuideDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit GuideDialog(QWidget *parent = 0);
+private:
+ QCheckBox *mCheckBox;
+
+private slots:
+ void setSetting();
+
+};
+
+#endif // GUIDEDIALOG_H
View
@@ -18,7 +18,8 @@ SOURCES += \
main.cpp \
extendedtabwidget.cpp \
config.cpp \
- pluginmanager.cpp
+ pluginmanager.cpp \
+ guidedialog.cpp
HEADERS += version.h \
platform.h \
@@ -27,7 +28,8 @@ HEADERS += version.h \
config.h \
interfaces/plugininterface.h \
pluginmanager.h \
- interfaces/editorinterface.h
+ interfaces/editorinterface.h \
+ guidedialog.h
FORMS += mainwindow.ui
View
@@ -30,6 +30,8 @@ along with OSTIS. If not, see <http://www.gnu.org/licenses/>.
#include "version.h"
+#include "guidedialog.h"
+
#include <QMdiSubWindow>
#include <QToolBar>
#include <QStyleFactory>
@@ -105,6 +107,10 @@ MainWindow::MainWindow(QWidget *parent) :
QSettings settings;
restoreGeometry(settings.value(Config::settingsMainWindowGeometry).toByteArray());
+ GuideDialog *mGuideDialog = new GuideDialog();
+ if (!settings.value("dontShowWindowOnStart").toBool())
+ mGuideDialog->exec();
+
setAcceptDrops(true);
}
@@ -179,6 +185,7 @@ void MainWindow::createActions()
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(helpAbout()));
connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(helpAboutQt()));
connect(ui->actionFeedback, SIGNAL(triggered()), this, SLOT(feedback()));
+ connect(ui->actionStart_Guide,SIGNAL(triggered()),this,SLOT(helpStartGuide()));
}
void MainWindow::updateEvent(EditorInterface *editor, EditEvents event)
@@ -587,6 +594,12 @@ void MainWindow::feedback()
.arg(tr("site")));
}
+void MainWindow::helpStartGuide()
+{
+ GuideDialog *mGuideDialog = new GuideDialog();
+ mGuideDialog->exec();
+}
+
void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
View
@@ -169,6 +169,7 @@ public slots:
void helpAbout();
void helpAboutQt();
void feedback();
+ void helpStartGuide();
//! Current tab has changed
void subWindowHasChanged(int index);
@@ -20,7 +20,7 @@
<x>0</x>
<y>0</y>
<width>600</width>
- <height>25</height>
+ <height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -58,6 +58,7 @@
<addaction name="actionAbout"/>
<addaction name="actionAbout_Qt"/>
<addaction name="actionFeedback"/>
+ <addaction name="actionStart_Guide"/>
</widget>
<widget class="QMenu" name="menuView">
<property name="title">
@@ -175,6 +176,11 @@
<string>Feedback</string>
</property>
</action>
+ <action name="actionStart_Guide">
+ <property name="text">
+ <string>Start Guide</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
@@ -1,8 +1,8 @@
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
-** Created: Sun Mar 4 12:13:25 2012
-** by: Qt User Interface Compiler version 4.7.4
+** Created: Sun 8. Apr 16:09:59 2012
+** by: Qt User Interface Compiler version 4.7.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -39,6 +39,8 @@ class Ui_MainWindow
QAction *actionClose_All;
QAction *actionClose_Others;
QAction *actionClose;
+ QAction *actionFeedback;
+ QAction *actionStart_Guide;
QWidget *centralWidget;
QMenuBar *menuBar;
QMenu *menuFile;
@@ -81,12 +83,16 @@ class Ui_MainWindow
actionClose = new QAction(MainWindow);
actionClose->setObjectName(QString::fromUtf8("actionClose"));
actionClose->setShortcutContext(Qt::WindowShortcut);
+ actionFeedback = new QAction(MainWindow);
+ actionFeedback->setObjectName(QString::fromUtf8("actionFeedback"));
+ actionStart_Guide = new QAction(MainWindow);
+ actionStart_Guide->setObjectName(QString::fromUtf8("actionStart_Guide"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QString::fromUtf8("menuBar"));
- menuBar->setGeometry(QRect(0, 0, 600, 25));
+ menuBar->setGeometry(QRect(0, 0, 600, 21));
menuFile = new QMenu(menuBar);
menuFile->setObjectName(QString::fromUtf8("menuFile"));
menuExport = new QMenu(menuFile);
@@ -121,6 +127,8 @@ class Ui_MainWindow
menuExport->addAction(actionTo_image);
menuHelp->addAction(actionAbout);
menuHelp->addAction(actionAbout_Qt);
+ menuHelp->addAction(actionFeedback);
+ menuHelp->addAction(actionStart_Guide);
retranslateUi(MainWindow);
@@ -152,6 +160,8 @@ class Ui_MainWindow
actionClose_Others->setText(QApplication::translate("MainWindow", "Close Others", 0, QApplication::UnicodeUTF8));
actionClose->setText(QApplication::translate("MainWindow", "Close", 0, QApplication::UnicodeUTF8));
actionClose->setShortcut(QApplication::translate("MainWindow", "Ctrl+W", 0, QApplication::UnicodeUTF8));
+ actionFeedback->setText(QApplication::translate("MainWindow", "Feedback", 0, QApplication::UnicodeUTF8));
+ actionStart_Guide->setText(QApplication::translate("MainWindow", "Start Guide", 0, QApplication::UnicodeUTF8));
menuFile->setTitle(QApplication::translate("MainWindow", "File", 0, QApplication::UnicodeUTF8));
menuExport->setTitle(QApplication::translate("MainWindow", "Export", 0, QApplication::UnicodeUTF8));
menuHelp->setTitle(QApplication::translate("MainWindow", "Help", 0, QApplication::UnicodeUTF8));

0 comments on commit c686c51

Please sign in to comment.