Permalink
Browse files

Various updates

  • Loading branch information...
bmcdorman committed Jan 19, 2013
1 parent 278a362 commit 1cbd01dd30750cded1c40cddbe85a159cd539453
View
@@ -36,7 +36,6 @@ ENDIF(WIN32)
SET(QT_USE_QTDECLARATIVE TRUE)
SET(QT_USE_QTNETWORK TRUE)
-SET(QT_USE_QTWEBKIT TRUE)
SET(QT_USE_QTSCRIPT TRUE)
INCLUDE(${QT_USE_FILE})
View
@@ -1,14 +1,12 @@
-#ifndef _BUILDOPTIONS_H_
-#define _BUILDOPTIONS_H_
+#ifndef _BUILD_OPTIONS_HPP_
+#define _BUILD_OPTIONS_HPP_
#define BUILD_AUDIO_TUTORIAL
#define BUILD_VIDEO_PLAYER_TAB
-#define BUILD_WEB_TAB
#define BUILD_REPOSITORY_TAB
#define BUILD_DOCUMENTATION_TAB
#define BUILD_DECLARATIVE_TAB
-#define BUILD_DEVELOPER_TOOLS
-
+// #define BUILD_DEVELOPER_TOOLS
// This option will enable GUI logging. Disables console output as a side-effect
// #define ENABLE_LOG_WINDOW
@@ -18,10 +16,6 @@
#undef BUILD_VIDEO_PLAYER_TAB
#endif
-#ifndef QT_WEBKIT_LIB
-#undef BUILD_WEB_TAB
-#endif
-
#ifndef QT_DECLARATIVE_LIB
#undef BUILD_DECLARATIVE_TAB
#endif
@@ -37,38 +37,46 @@ namespace Ui
class ThemeSettingsDialog;
}
-class ThemeSettingsDialog : public QDialog
+namespace Kiss
{
-Q_OBJECT
-public:
- ThemeSettingsDialog(QWidget *parent = 0);
- ~ThemeSettingsDialog();
-
- virtual int exec();
-
- const QMap<QString, QColor>& settings() const;
- QColor backgroundColor() const;
- QFont font() const;
- int fontSize() const;
-
- void readSettings();
- void writeSettings();
-
-public slots:
- void setDefaults();
-
-private slots:
- void settingChanged(QColor color);
-
-private:
- void updateBoxes();
-
- Ui::ThemeSettingsDialog *ui;
- QMap<QString, QColor> m_lexerSettings;
- ColorBox **m_boxes;
- int m_fontSize;
- QFont m_font;
- QColor m_backgroundColor;
-};
+ namespace Dialog
+ {
+ class ThemeSettings : public QDialog
+ {
+ Q_OBJECT
+ public:
+ ThemeSettings(QWidget *parent = 0);
+ ~ThemeSettings();
+
+ virtual int exec();
+
+ const QMap<QString, QColor>& settings() const;
+ QColor backgroundColor() const;
+ QFont font() const;
+ int fontSize() const;
+
+ void readSettings();
+ void writeSettings();
+
+ static void initializeDefaults();
+
+ public slots:
+ void setDefaults();
+
+ private slots:
+ void settingChanged(QColor color);
+
+ private:
+ void updateBoxes();
+
+ ::Ui::ThemeSettingsDialog *ui;
+ QMap<QString, QColor> m_lexerSettings;
+ ColorBox **m_boxes;
+ int m_fontSize;
+ QFont m_font;
+ QColor m_backgroundColor;
+ };
+ }
+}
#endif
View
@@ -231,7 +231,7 @@ namespace Kiss
private:
Tab *m_currentTab;
EditorSettingsDialog m_editorSettingsDialog;
- ThemeSettingsDialog m_themeSettingsDialog;
+ Dialog::ThemeSettings m_themeSettingsDialog;
QMap<QWidget *, Tab *> m_lookup;
Menu::Manager m_menuManager;
Template::Manager *m_templateManager;
View
@@ -1,119 +0,0 @@
-/**************************************************************************
- * Copyright 2007-2011 KISS Institute for Practical Robotics *
- * *
- * This file is part of KISS (Kipr's Instructional Software System). *
- * *
- * KISS is free software: you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation, either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * KISS is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with KISS. Check the LICENSE file in the project root. *
- * If not, see <http://www.gnu.org/licenses/>. *
- **************************************************************************/
-
-#ifndef _WEB_TAB_HPP_
-#define _WEB_TAB_HPP_
-
-#include "build_options.hpp"
-
-#include <QObject>
-
-namespace Kiss
-{
- namespace Widget
- {
- class WebTab;
- }
-}
-
-#ifdef BUILD_WEB_TAB
-
-#include "tab.hpp"
-#include "macro_string.hpp"
-
-#include "ui_WebTab.h"
-
-#define KISS_BACKGROUND "KISS_BACKGROUND"
-
-class QWebHistory;
-class QWebView;
-
-namespace Kiss
-{
- namespace Widget
- {
- class MainWindow;
-
- class WebTab : public QWidget, public Tab, protected Ui::WebTab
- {
- Q_OBJECT
- public:
- WebTab(MainWindow* parent = 0);
- ~WebTab();
-
- virtual void activate();
-
- bool beginSetup();
- virtual void completeSetup();
-
- bool close();
-
- //! Loads an unformatted URL
- void load(QString url, bool hideUrl = false);
- QString current();
- QWebHistory* history();
-
- QWebView* webView();
-
- public slots:
- void copy();
- void cut();
- void paste();
-
- void back();
- void forward();
- void go();
- void refresh();
-
- //! Opens current web page in system's default browser
- void openInBrowser();
-
- void find();
-
- signals:
- void updateActivatable();
-
- private slots:
- void updateTitle(const QString& title);
- void updateUrl(const QUrl& url);
-
- void on_actionGo_triggered();
-
- void on_ui_prevFind_clicked();
- void on_ui_nextFind_clicked();
-
- //! Check if there was an error loading the page
- void on_ui_webView_loadFinished(bool ok);
-
- void refreshSettings();
-
- private slots:
- void linkClicked(const QUrl& url);
-
- private:
- QUrl m_prevUrl;
- MacroString m_fragmentMacro;
- };
- }
-}
-
-#endif
-
-#endif
@@ -71,7 +71,7 @@ const bool KovanInterface::scan(InterfaceResponder *responder)
fprintf(stderr, "scan\n");
m_responder = responder;
m_advertiser->reset();
- AdvertSampler *sampler = new AdvertSampler(m_advertiser, 100, 100);
+ AdvertSampler *sampler = new AdvertSampler(m_advertiser, 100, 75);
sampler->setAutoDelete(true);
qRegisterMetaType<Advert>("Advert");
qRegisterMetaType<sockaddr_in>("sockaddr_in");
View
@@ -26,10 +26,10 @@
#include <QGraphicsObject>
#include <QtDeclarative>
+#include <QDesktopServices>
#include "developer_menu.hpp"
#include "main_window.hpp"
-#include "web_tab.hpp"
using namespace Kiss;
using namespace Kiss::Widget;
@@ -50,21 +50,17 @@ void DeclarativeTools::open()
m_mainWindow->open();
}
-void DeclarativeTools::openWeb(const QString& url)
+void DeclarativeTools::openWeb(const QString &url)
{
-#ifdef BUILD_WEB_TAB
- WebTab *webTab = new WebTab(m_mainWindow);
- webTab->load(url);
- m_mainWindow->addTab(webTab);
-#endif
+ QDesktopServices::openUrl(QUrl::fromUserInput(url));
}
void DeclarativeTools::settings()
{
m_mainWindow->settings();
}
-const QStringList DeclarativeTools::templates(const QString& target)
+const QStringList DeclarativeTools::templates(const QString &target)
{
return QStringList();
}
@@ -31,11 +31,12 @@
#include <QDebug>
using namespace Kiss;
+using namespace Kiss::Dialog;
-ThemeSettingsDialog::ThemeSettingsDialog(QWidget *parent)
- : QDialog(parent)
+ThemeSettings::ThemeSettings(QWidget *parent)
+ : QDialog(parent),
+ ui(new Ui::ThemeSettingsDialog())
{
- ui = new Ui::ThemeSettingsDialog();
ui->setupUi(this);
ui->table->setColumnWidth(0, 180);
@@ -53,42 +54,42 @@ ThemeSettingsDialog::ThemeSettingsDialog(QWidget *parent)
connect(ui->reset, SIGNAL(clicked()), SLOT(setDefaults()));
}
-ThemeSettingsDialog::~ThemeSettingsDialog()
+ThemeSettings::~ThemeSettings()
{
for(quint16 i = 0; i < ui->table->rowCount(); ++i) delete m_boxes[i];
delete m_boxes;
delete ui;
}
-int ThemeSettingsDialog::exec()
+int ThemeSettings::exec()
{
readSettings();
if(!QDialog::exec()) return QDialog::Rejected;
writeSettings();
return QDialog::Accepted;
}
-const QMap<QString, QColor>& ThemeSettingsDialog::settings() const
+const QMap<QString, QColor>& ThemeSettings::settings() const
{
return m_lexerSettings;
}
-QColor ThemeSettingsDialog::backgroundColor() const
+QColor ThemeSettings::backgroundColor() const
{
return ui->backgroundColorBox->color();
}
-QFont ThemeSettingsDialog::font() const
+QFont ThemeSettings::font() const
{
return ui->fontBox->currentFont();
}
-int ThemeSettingsDialog::fontSize() const
+int ThemeSettings::fontSize() const
{
return ui->fontSizeBox->value();
}
-void ThemeSettingsDialog::readSettings()
+void ThemeSettings::readSettings()
{
QSettings settings;
@@ -128,7 +129,7 @@ void ThemeSettingsDialog::readSettings()
updateBoxes();
}
-void ThemeSettingsDialog::writeSettings()
+void ThemeSettings::writeSettings()
{
QSettings settings;
@@ -146,7 +147,7 @@ void ThemeSettingsDialog::writeSettings()
settings.endGroup();
}
-void ThemeSettingsDialog::setDefaults()
+void ThemeSettings::setDefaults()
{
m_lexerSettings[DEFAULT] = SyntaxStandards::defaultColor();
m_lexerSettings[COMMENT] = SyntaxStandards::commentColor();
@@ -162,14 +163,20 @@ void ThemeSettingsDialog::setDefaults()
updateBoxes();
}
-void ThemeSettingsDialog::settingChanged(QColor color)
+void ThemeSettings::initializeDefaults()
+{
+ // This is sooo jank
+ delete new ThemeSettings(0);
+}
+
+void ThemeSettings::settingChanged(QColor color)
{
ColorBox *box = (ColorBox *)sender();
QString setting = ui->table->item(box->property("row").toInt(), 0)->text();
m_lexerSettings.insert(setting, color);
}
-void ThemeSettingsDialog::updateBoxes()
+void ThemeSettings::updateBoxes()
{
m_boxes[0]->setColor(m_lexerSettings.value(DEFAULT, SyntaxStandards::defaultColor()));
m_boxes[1]->setColor(m_lexerSettings.value(COMMENT, SyntaxStandards::commentColor()));
Oops, something went wrong.

0 comments on commit 1cbd01d

Please sign in to comment.