MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / UBFeaturesWidget

Method UBFeaturesWidget

src/gui/UBFeaturesWidget.cpp:51–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49static const QString mimeSankoreFeatureTypes = "Sankore/featureTypes";
50
51UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name)
52 : UBDockPaletteWidget(parent)
53 , imageGatherer(NULL)
54{
55 setObjectName(name);
56 mName = "FeaturesWidget";
57 mVisibleState = true;
58
59 SET_STYLE_SHEET();
60
61 mIconToLeft = QPixmap(":images/library_open.png");
62 mIconToRight = QPixmap(":images/library_close.png");
63 setAcceptDrops(true);
64
65 //Main UBFeature functionality
66 controller = new UBFeaturesController(this);
67
68 //Main layout including all the widgets in palette
69 layout = new QVBoxLayout(this);
70
71 //Path icon view on the top of the palette
72 pathListView = new UBFeaturesListView(this, objNamePathList);
73 controller->assignPathListView(pathListView);
74
75 centralWidget = new UBFeaturesCentralWidget(this);
76 controller->assignFeaturesListView(centralWidget->listView());
77 centralWidget->setSliderPosition(UBSettings::settings()->featureSliderPosition->get().toInt());
78
79 //Bottom actionbar for DnD, quick search etc
80 mActionBar = new UBFeaturesActionBar(controller, this);
81
82 //Filling main layout
83 layout->addWidget(pathListView);
84 layout->addWidget(centralWidget);
85 layout->addWidget(mActionBar);
86
87 connect(centralWidget->listView(), SIGNAL(pressed(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &)));
88 connect(this, SIGNAL(sendFileNameList(QStringList)), centralWidget, SIGNAL(sendFileNameList(QStringList)));
89 connect(mActionBar, SIGNAL(searchElement(const QString &)), this, SLOT( searchStarted(const QString &)));
90 connect(mActionBar, SIGNAL(newFolderToCreate()), this, SLOT(createNewFolder()));
91 connect(mActionBar, SIGNAL(deleteElements(const UBFeaturesMimeData *)), this, SLOT(deleteElements(const UBFeaturesMimeData *)));
92 connect(mActionBar, SIGNAL(deleteSelectedElements()), this, SLOT(deleteSelectedElements()));
93 connect(mActionBar, SIGNAL(addElementsToFavorite() ), this, SLOT ( addElementsToFavorite()) );
94 connect(mActionBar, SIGNAL(removeElementsFromFavorite()), this, SLOT (removeElementsFromFavorite()));
95
96 connect(mActionBar, SIGNAL(rescanModel()), this, SLOT(rescanModel()));
97 connect(pathListView, SIGNAL(pressed(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &)));
98 connect(UBApplication::boardController, SIGNAL(displayMetadata(QMap<QString,QString>)), this, SLOT(onDisplayMetadata( QMap<QString,QString>)));
99 connect(UBDownloadManager::downloadManager(), SIGNAL( addDownloadedFileToLibrary( bool, QUrl, QString, QByteArray, QString))
100 , this, SLOT(onAddDownloadedFileToLibrary(bool, QUrl, QString,QByteArray, QString)));
101 connect(centralWidget, SIGNAL(lockMainWidget(bool)), this, SLOT(lockIt(bool)));
102 connect(centralWidget, SIGNAL(createNewFolderSignal(QString)), controller, SLOT(addNewFolder(QString)));
103 connect(controller, SIGNAL(scanStarted()), centralWidget, SLOT(scanStarted()));
104 connect(controller, SIGNAL(scanFinished()), centralWidget, SLOT(scanFinished()));
105 connect(controller, SIGNAL(scanStarted()), mActionBar, SLOT(lockIt()));
106 connect(controller, SIGNAL(scanFinished()), mActionBar, SLOT(unlockIt()));
107 connect(controller, SIGNAL(maxFilesCountEvaluated(int)), centralWidget, SIGNAL(maxFilesCountEvaluated(int)));
108 connect(controller, SIGNAL(featureAddedFromThread()), centralWidget, SIGNAL(increaseStatusBarValue()));

Callers

nothing calls this directly

Calls 6

assignPathListViewMethod · 0.80
addWidgetMethod · 0.80
listViewMethod · 0.45
setSliderPositionMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected