[Tux4kids-commits] r1135 - tux4kids-admin/trunk/src

Michał Świtakowski swistakers-guest at alioth.debian.org
Thu Jul 2 22:26:35 UTC 2009


Author: swistakers-guest
Date: 2009-07-02 22:26:35 +0000 (Thu, 02 Jul 2009)
New Revision: 1135

Added:
   tux4kids-admin/trunk/src/pluginManagerDialog.cpp
   tux4kids-admin/trunk/src/pluginManagerDialog.h
   tux4kids-admin/trunk/src/pluginManagerDialog.ui
Modified:
   tux4kids-admin/trunk/src/mainController.cpp
   tux4kids-admin/trunk/src/mainController.h
   tux4kids-admin/trunk/src/mainWindow.cpp
   tux4kids-admin/trunk/src/mainWindow.h
   tux4kids-admin/trunk/src/mainWindow.ui
   tux4kids-admin/trunk/src/src.pro
Log:
added plugin manager dialog

Modified: tux4kids-admin/trunk/src/mainController.cpp
===================================================================
--- tux4kids-admin/trunk/src/mainController.cpp	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/mainController.cpp	2009-07-02 22:26:35 UTC (rev 1135)
@@ -4,9 +4,9 @@
 
 MainController::MainController()
 {
-	pluginManager.loadPlugins();
+	m_pluginManager.loadPlugins();
 
-	if (pluginManager.empty()) {
+	if (m_pluginManager.empty()) {
 		qDebug() << tr("Failed to load plugins");
 	}
 }
@@ -15,3 +15,9 @@
 {
 }
 
+PluginManager *MainController::pluginManager()
+{
+	return &m_pluginManager;
+}
+
+

Modified: tux4kids-admin/trunk/src/mainController.h
===================================================================
--- tux4kids-admin/trunk/src/mainController.h	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/mainController.h	2009-07-02 22:26:35 UTC (rev 1135)
@@ -14,9 +14,11 @@
 	MainController();
 	~MainController();
 
+	PluginManager *pluginManager();
+
 private:
 
-	PluginManager pluginManager;
+	PluginManager m_pluginManager;
 };
 
 #endif // MAINCONTROLLER_H

Modified: tux4kids-admin/trunk/src/mainWindow.cpp
===================================================================
--- tux4kids-admin/trunk/src/mainWindow.cpp	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/mainWindow.cpp	2009-07-02 22:26:35 UTC (rev 1135)
@@ -1,14 +1,23 @@
 #include "mainWindow.h"
 #include "ui_mainWindow.h"
+#include "pluginManagerDialog.h"
 
 MainWindow::MainWindow(MainController *controller, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
 {
 	ui->setupUi(this);
 
 	mainController = controller;
+
+	connect(ui->actionPlugins, SIGNAL(triggered()), this, SLOT(pluginsManagerClicked()));
 }
 
 MainWindow::~MainWindow()
 {
 	delete ui;
 }
+
+void MainWindow::pluginsManagerClicked()
+{
+	PluginManagerDialog pluginManagerDialog(mainController->pluginManager(), this);
+	pluginManagerDialog.exec();
+}

Modified: tux4kids-admin/trunk/src/mainWindow.h
===================================================================
--- tux4kids-admin/trunk/src/mainWindow.h	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/mainWindow.h	2009-07-02 22:26:35 UTC (rev 1135)
@@ -22,6 +22,10 @@
 	Ui::MainWindow *ui;
 
 	MainController *mainController;
+
+private slots:
+	void pluginsManagerClicked();
+
 };
 
 #endif // MAINWINDOW_H

Modified: tux4kids-admin/trunk/src/mainWindow.ui
===================================================================
--- tux4kids-admin/trunk/src/mainWindow.ui	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/mainWindow.ui	2009-07-02 22:26:35 UTC (rev 1135)
@@ -1,4 +1,4 @@
-<ui version="4.0">
+<ui version="4.0" >
  <class>MainWindow</class>
  <widget class="QMainWindow" name="MainWindow" >
   <property name="geometry" >
@@ -12,13 +12,40 @@
   <property name="windowTitle" >
    <string>MainWindow</string>
   </property>
-  <widget class="QMenuBar" name="menuBar" />
-  <widget class="QToolBar" name="mainToolBar" />
   <widget class="QWidget" name="centralWidget" />
+  <widget class="QMenuBar" name="menuBar" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>600</width>
+     <height>30</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuSettings" >
+    <property name="title" >
+     <string>Settings</string>
+    </property>
+    <addaction name="actionPlugins" />
+   </widget>
+   <addaction name="menuSettings" />
+  </widget>
+  <widget class="QToolBar" name="mainToolBar" >
+   <attribute name="toolBarArea" >
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak" >
+    <bool>false</bool>
+   </attribute>
+  </widget>
   <widget class="QStatusBar" name="statusBar" />
+  <action name="actionPlugins" >
+   <property name="text" >
+    <string>Plugins...</string>
+   </property>
+  </action>
  </widget>
- <layoutDefault spacing="6" margin="11" />
- <pixmapfunction></pixmapfunction>
+ <layoutdefault spacing="6" margin="11" />
  <resources/>
  <connections/>
 </ui>

Added: tux4kids-admin/trunk/src/pluginManagerDialog.cpp
===================================================================
--- tux4kids-admin/trunk/src/pluginManagerDialog.cpp	                        (rev 0)
+++ tux4kids-admin/trunk/src/pluginManagerDialog.cpp	2009-07-02 22:26:35 UTC (rev 1135)
@@ -0,0 +1,25 @@
+#include "pluginManagerDialog.h"
+#include "ui_pluginManagerDialog.h"
+
+PluginManagerDialog::PluginManagerDialog(PluginManager *newPluginManager, QWidget *parent) : QDialog(parent), m_ui(new Ui::PluginManagerDialog)
+{
+	m_ui->setupUi(this);
+	m_ui->pluginsList->setModel(newPluginManager);
+}
+
+PluginManagerDialog::~PluginManagerDialog()
+{
+	delete m_ui;
+}
+
+void PluginManagerDialog::changeEvent(QEvent *e)
+{
+	QDialog::changeEvent(e);
+	switch (e->type()) {
+	case QEvent::LanguageChange:
+		m_ui->retranslateUi(this);
+		break;
+	default:
+		break;
+	}
+}

Added: tux4kids-admin/trunk/src/pluginManagerDialog.h
===================================================================
--- tux4kids-admin/trunk/src/pluginManagerDialog.h	                        (rev 0)
+++ tux4kids-admin/trunk/src/pluginManagerDialog.h	2009-07-02 22:26:35 UTC (rev 1135)
@@ -0,0 +1,28 @@
+#ifndef PLUGINMANAGERDIALOG_H
+#define PLUGINMANAGERDIALOG_H
+
+#include <QtGui/QDialog>
+
+#include "pluginManager.h"
+
+namespace Ui {
+	class PluginManagerDialog;
+}
+
+class PluginManagerDialog : public QDialog
+{
+	Q_OBJECT
+	Q_DISABLE_COPY(PluginManagerDialog)
+public:
+	explicit PluginManagerDialog(PluginManager *newPluginManager, QWidget *parent = 0);
+	virtual ~PluginManagerDialog();
+
+protected:
+	virtual void changeEvent(QEvent *e);
+
+private:
+	Ui::PluginManagerDialog *m_ui;
+
+};
+
+#endif // PLUGINMANAGERDIALOG_H

Added: tux4kids-admin/trunk/src/pluginManagerDialog.ui
===================================================================
--- tux4kids-admin/trunk/src/pluginManagerDialog.ui	                        (rev 0)
+++ tux4kids-admin/trunk/src/pluginManagerDialog.ui	2009-07-02 22:26:35 UTC (rev 1135)
@@ -0,0 +1,30 @@
+<ui version="4.0" >
+ <class>PluginManagerDialog</class>
+ <widget class="QDialog" name="PluginManagerDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Loaded plugins</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QListView" name="pluginsList" />
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

Modified: tux4kids-admin/trunk/src/src.pro
===================================================================
--- tux4kids-admin/trunk/src/src.pro	2009-07-02 21:57:35 UTC (rev 1134)
+++ tux4kids-admin/trunk/src/src.pro	2009-07-02 22:26:35 UTC (rev 1135)
@@ -4,8 +4,11 @@
 SOURCES += main.cpp \
     mainWindow.cpp \
     mainController.cpp \
-    pluginManager.cpp
+    pluginManager.cpp \
+    pluginManagerDialog.cpp
 HEADERS += mainWindow.h \
     mainController.h \
-    pluginManager.h
-FORMS += mainWindow.ui
+    pluginManager.h \
+    pluginManagerDialog.h
+FORMS += mainWindow.ui \
+    pluginManagerDialog.ui




More information about the Tux4kids-commits mailing list