aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.cpp
blob: 3080c3770b607dfce1aaa6326a2d7f5819e26af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//===========================================
//  Lumina-desktop source code
//  Copyright (c) 2018, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include "Plugin.h"

//Add includes for individual plugin files here
#include <ClockPlugin.h>
#include <SpacerPlugin.h>
#include <StatusTrayPlugin.h>

QStringList Plugin::built_in_plugins(){
  QStringList list;
  list << "clock" << "spacer" << "statustray";
  return list;
}

Plugin* Plugin::createPlugin(QWidget *parent, QString id, bool panelplug, bool vertical){
  Plugin *plug = 0;
  QString id_extra, id_primary;
  if(id.contains("--")){ id_extra = id.section("--",1,-1); id_primary = id.section("--",0,0); }
  else{ id_primary = id; } //no extra info on this one
  id_primary = id_primary.toLower();
  if(id_primary=="clock"){
    plug = new ClockPlugin(parent, id, panelplug, vertical);
  }else if(id_primary=="spacer"){
    plug = new SpacerPlugin(parent, id, panelplug, vertical);
  }else if(id_primary=="statustray"){
    plug = new StatusTrayPlugin(parent, id, panelplug, vertical);
  }

  return plug;
}
bgstack15