00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PLUGIN_SELECTOR_DIALOG_H
00023 #define PLUGIN_SELECTOR_DIALOG_H
00024
00025 #include <QDialog>
00026
00027 #include <QtGui/QApplication>
00028 #include <QtGui/QHBoxLayout>
00029 #include <QtGui/QLabel>
00030 #include <QtGui/QPushButton>
00031 #include <QtGui/QSpacerItem>
00032 #include <QtGui/QTreeWidget>
00033 #include <QtGui/QVBoxLayout>
00034
00035
00036 class Plugin;
00037
00038 class PluginSelectorDialog : public QDialog
00039 {
00040 Q_OBJECT
00041
00042 public:
00043
00044 static PluginSelectorDialog* instance();
00045
00046 Plugin* get_selected_plugin();
00047 void set_description(const QString& des);
00048
00049 private:
00050 PluginSelectorDialog(QWidget* parent = 0);
00051 ~PluginSelectorDialog();
00052
00053 static PluginSelectorDialog* m_instance;
00054
00055 QVBoxLayout *vboxLayout;
00056 QLabel *objectToAddPluginTooLabel;
00057 QTreeWidget *pluginTreeWidget;
00058 QHBoxLayout *hboxLayout;
00059 QSpacerItem *spacerItem;
00060 QPushButton *okButton;
00061 QPushButton *cancelButton;
00062
00063 Plugin* m_plugin;
00064
00065 void setupUi(QDialog *PluginSelectorDialog)
00066 {
00067 if (PluginSelectorDialog->objectName().isEmpty())
00068 PluginSelectorDialog->setObjectName(QString::fromUtf8("PluginSelectorDialog"));
00069 QSize size(471, 433);
00070 size = size.expandedTo(PluginSelectorDialog->minimumSizeHint());
00071 PluginSelectorDialog->resize(size);
00072 vboxLayout = new QVBoxLayout(PluginSelectorDialog);
00073 #ifndef Q_OS_MAC
00074 vboxLayout->setSpacing(6);
00075 #endif
00076 #ifndef Q_OS_MAC
00077 vboxLayout->setMargin(9);
00078 #endif
00079 vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
00080 objectToAddPluginTooLabel = new QLabel(PluginSelectorDialog);
00081 objectToAddPluginTooLabel->setObjectName(QString::fromUtf8("objectToAddPluginTooLabel"));
00082
00083 vboxLayout->addWidget(objectToAddPluginTooLabel);
00084
00085 pluginTreeWidget = new QTreeWidget(PluginSelectorDialog);
00086 pluginTreeWidget->setObjectName(QString::fromUtf8("pluginTreeWidget"));
00087
00088 vboxLayout->addWidget(pluginTreeWidget);
00089
00090 hboxLayout = new QHBoxLayout();
00091 #ifndef Q_OS_MAC
00092 hboxLayout->setSpacing(6);
00093 #endif
00094 hboxLayout->setMargin(0);
00095 hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
00096 spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
00097
00098 hboxLayout->addItem(spacerItem);
00099
00100 okButton = new QPushButton(PluginSelectorDialog);
00101 okButton->setObjectName(QString::fromUtf8("okButton"));
00102
00103 hboxLayout->addWidget(okButton);
00104
00105 cancelButton = new QPushButton(PluginSelectorDialog);
00106 cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
00107
00108 hboxLayout->addWidget(cancelButton);
00109
00110
00111 vboxLayout->addLayout(hboxLayout);
00112
00113
00114 retranslateUi(PluginSelectorDialog);
00115 QObject::connect(cancelButton, SIGNAL(clicked()), PluginSelectorDialog, SLOT(reject()));
00116 QObject::connect(okButton, SIGNAL(clicked()), PluginSelectorDialog, SLOT(accept()));
00117 QObject::connect(pluginTreeWidget, SIGNAL(activated(QModelIndex)), okButton, SLOT(click()));
00118
00119 QMetaObject::connectSlotsByName(PluginSelectorDialog);
00120 }
00121
00122 void retranslateUi(QDialog *PluginSelectorDialog)
00123 {
00124 PluginSelectorDialog->setWindowTitle(QApplication::translate("PluginSelectorDialog", "Plugin Selector", 0, QApplication::UnicodeUTF8));
00125 objectToAddPluginTooLabel->setText(QApplication::translate("PluginSelectorDialog", "Add Plugin too", 0, QApplication::UnicodeUTF8));
00126 pluginTreeWidget->headerItem()->setText(0, QApplication::translate("PluginSelectorDialog", "Plugin Name", 0, QApplication::UnicodeUTF8));
00127 pluginTreeWidget->headerItem()->setText(1, QApplication::translate("PluginSelectorDialog", "Type", 0, QApplication::UnicodeUTF8));
00128 pluginTreeWidget->headerItem()->setText(2, QApplication::translate("PluginSelectorDialog", "In/Out", 0, QApplication::UnicodeUTF8));
00129 okButton->setText(QApplication::translate("PluginSelectorDialog", "OK", 0, QApplication::UnicodeUTF8));
00130 cancelButton->setText(QApplication::translate("PluginSelectorDialog", "Cancel", 0, QApplication::UnicodeUTF8));
00131 Q_UNUSED(PluginSelectorDialog);
00132 }
00133
00134 private slots:
00135 void on_okButton_clicked();
00136 void on_cancelButton_clicked();
00137 void plugin_double_clicked();
00138
00139 };
00140
00141 #endif
00142
00143
00144
00145