Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove depreacted/unused selector widget.

  • Loading branch information...
commit 0ed7f2cb075573da32b2d3765632505d1d43f6d6 1 parent 9fe585d
@stuartm stuartm authored
View
5 mythtv/libs/libmyth/mythdialogs.cpp
@@ -1613,11 +1613,6 @@ UICheckBoxType* MythThemedDialog::getUICheckBoxType(const QString &name)
return GetUIType<UICheckBoxType>(this, name);
}
-UISelectorType* MythThemedDialog::getUISelectorType(const QString &name)
-{
- return GetUIType<UISelectorType>(this, name);
-}
-
UIBlackHoleType* MythThemedDialog::getUIBlackHoleType(const QString &name)
{
return GetUIType<UIBlackHoleType>(this, name);
View
2  mythtv/libs/libmyth/mythdialogs.h
@@ -23,7 +23,6 @@ class UIPushButtonType;
class UITextButtonType;
class UIRepeatedImageType;
class UICheckBoxType;
-class UISelectorType;
class UIBlackHoleType;
class UIImageType;
class UIStatusBarType;
@@ -371,7 +370,6 @@ class MPUBLIC MythThemedDialog : public MythDialog
UITextButtonType *getUITextButtonType(const QString &name);
UIRepeatedImageType *getUIRepeatedImageType(const QString &name);
UICheckBoxType *getUICheckBoxType(const QString &name);
- UISelectorType *getUISelectorType(const QString &name);
UIBlackHoleType *getUIBlackHoleType(const QString &name);
UIImageType *getUIImageType(const QString &name);
UIStatusBarType *getUIStatusBarType(const QString &name);
View
159 mythtv/libs/libmyth/uitypes.cpp
@@ -3230,165 +3230,6 @@ void UICheckBoxType::setState(bool checked_or_not)
// ********************************************************************
-UISelectorType::UISelectorType(const QString &name, QPixmap on, QPixmap off,
- QPixmap pushed, QRect area)
- : UIPushButtonType(name, on, off, pushed)
-{
- m_area = area;
- current_data = NULL;
-}
-
-void UISelectorType::Draw(QPainter *p, int drawlayer, int context)
-{
- if (hidden)
- return;
-
- if (context != m_context)
- {
- if (m_context != -1)
- {
- return;
- }
- }
-
- if (drawlayer != m_order)
- {
- // not my turn
- return;
- }
-
- if (currently_pushed)
- {
- p->drawPixmap(m_displaypos.x(), m_displaypos.y(), pushed_pixmap);
- }
- else
- {
- if (has_focus)
- {
- p->drawPixmap(m_displaypos.x(), m_displaypos.y(), on_pixmap);
- }
- else
- {
- p->drawPixmap(m_displaypos.x(), m_displaypos.y(), off_pixmap);
- }
- }
- if (current_data)
- {
- p->setFont(m_font->face);
- p->setBrush(m_font->color);
- p->setPen(QPen(m_font->color, (int)(2 * m_wmult)));
- p->drawText(m_displaypos.x() + on_pixmap.width() + 4,
- m_displaypos.y() + 4, // HACK!!!
- m_area.right(),
- m_area.bottom(),
- Qt::AlignLeft,
- current_data->getString());
- }
-}
-
-void UISelectorType::calculateScreenArea()
-{
- QRect r = m_area;
- r.translate(m_parent->GetAreaRect().left(), m_parent->GetAreaRect().top());
- screen_area = r;
-}
-
-void UISelectorType::addItem(int an_int, const QString &a_string)
-{
- IntStringPair *new_data = new IntStringPair(an_int, a_string);
- my_data.append(new_data);
- if (!current_data)
- {
- current_data = new_data;
- }
-}
-
-void UISelectorType::setToItem(int which_item)
-{
- for(uint i = 0; i < (uint)my_data.size(); i++)
- {
- if (my_data[i]->getInt() == which_item)
- {
- current_data = my_data[i];
- refresh();
- }
- }
-}
-
-void UISelectorType::setToItem(const QString &which_item)
-{
- for (uint i = 0; i < (uint)my_data.size(); i++)
- {
- if (my_data[i]->getString() == which_item)
- {
- current_data = my_data[i];
- refresh();
- }
- }
-}
-
-QString UISelectorType::getCurrentString()
-{
- if (current_data)
- return current_data->getString();
- else
- return "";
-}
-
-int UISelectorType::getCurrentInt()
-{
- if (current_data)
- return current_data->getInt();
- else
- return -1;
-}
-
-
-void UISelectorType::push(bool up_or_down)
-{
- if (currently_pushed)
- {
- return;
- }
- currently_pushed = true;
- push_timer.setSingleShot(true);
- push_timer.start(300);
-
- if (current_data)
- {
- int cur_indx = my_data.indexOf(current_data);
- int next_indx = (up_or_down) ? cur_indx + 1 : cur_indx - 1;
-
- if (next_indx >= my_data.size())
- current_data = my_data.empty() ? NULL : my_data.front();
- else if (next_indx < 0)
- current_data = my_data.empty() ? NULL : my_data.back();
- else
- current_data = my_data[next_indx];
-
- if (current_data)
- emit pushed(current_data->getInt());
- }
- refresh();
-}
-
-void UISelectorType::unPush()
-{
- currently_pushed = false;
- refresh();
-}
-
-UISelectorType::~UISelectorType()
-{
- while (!my_data.empty())
- {
- delete my_data.back();
- my_data.pop_back();
- }
-}
-
-// ********************************************************************
-
UIBlackHoleType::UIBlackHoleType(const QString &name)
: UIType(name)
{
View
69 mythtv/libs/libmyth/uitypes.h
@@ -680,75 +680,6 @@ class MPUBLIC UICheckBoxType : public UIType
QString label;
};
-class IntStringPair
-{
- // Minuscule class for holding data
- // in a UISelectorType (below)
-
- public:
-
- IntStringPair(int an_int, const QString a_string){my_int = an_int; my_string = a_string;}
-
- void setString(const QString &a_string){my_string = a_string;}
- void setInt(int an_int){my_int = an_int;}
- QString getString(){return my_string;}
- int getInt(){return my_int;}
-
-
- private:
-
- int my_int;
- QString my_string;
-
-};
-
-
-class MPUBLIC UISelectorType : public UIPushButtonType
-{
- Q_OBJECT
-
- //
- // A theme-able "thingy" (that's the
- // official term) that can hold a list
- // of strings and emit an int and/or
- // the string when the user selects
- // from among them.
- //
-
- public:
-
- UISelectorType(const QString &name, QPixmap on, QPixmap off, QPixmap pushed, QRect area);
- ~UISelectorType();
-
- void Draw(QPainter *, int drawlayer, int context);
- void calculateScreenArea();
- void addItem(int an_int, const QString &a_string);
- void setFont(fontProp *font) { m_font = font; }
- QString getCurrentString();
- int getCurrentInt();
-
- public slots:
-
- void push(bool up_or_down);
- void unPush();
- void activate(){push(true);}
- void cleanOut(){current_data = NULL; my_data.clear();}
- void setToItem(int which_item);
- void setToItem(const QString &which_item);
-
- signals:
-
- void pushed(int);
-
- private:
-
- QRect m_area;
- fontProp *m_font;
- QList<IntStringPair*> my_data;
- IntStringPair *current_data;
-
-};
-
class MPUBLIC UIBlackHoleType : public UIType
{
Q_OBJECT
View
146 mythtv/libs/libmyth/xmlparse.cpp
@@ -762,10 +762,6 @@ void XMLParse::parseContainer(QDomElement &element, QString &newname, int &conte
{
parseCheckBox(container, info);
}
- else if (info.tagName() == "selector")
- {
- parseSelector(container, info);
- }
else if (info.tagName() == "blackhole")
{
parseBlackHole(container, info);
@@ -2216,148 +2212,6 @@ void XMLParse::parseCheckBox(LayerSet *container, QDomElement &element)
container->AddType(cbt);
}
-void XMLParse::parseSelector(LayerSet *container, QDomElement &element)
-{
- int context = -1;
- QString font = "";
- QRect area;
- QPixmap *image_on = NULL;
- QPixmap *image_off = NULL;
- QPixmap *image_pushed = NULL;
-
- QString name = element.attribute("name", "");
- if (name.isNull() || name.isEmpty())
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC + "Selector needs a name");
- return;
- }
-
- QString order = element.attribute("draworder", "");
- if (order.isNull() || order.isEmpty())
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC + "Selector needs an order");
- return;
- }
-
- for (QDomNode child = element.firstChild(); !child.isNull();
- child = child.nextSibling())
- {
- QDomElement info = child.toElement();
- if (!info.isNull())
- {
- if (info.tagName() == "context")
- {
- context = getFirstText(info).toInt();
- }
- else if (info.tagName() == "area")
- {
- area = parseRect(getFirstText(info));
- normalizeRect(area);
- }
- else if (info.tagName() == "font")
- {
- font = getFirstText(info);
- }
- else if (info.tagName() == "image")
- {
- QString imgname = "";
- QString file = "";
-
- imgname = info.attribute("function", "");
- if (imgname.isNull() || imgname.isEmpty())
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- "Image in a selector needs a function");
- return;
- }
-
- file = info.attribute("filename", "");
- if (file.isNull() || file.isEmpty())
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- "Image in a selector needs a filename");
- return;
- }
-
- if (imgname.toLower() == "on")
- {
- image_on = ui->LoadScalePixmap(file);
- if (!image_on)
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- QString("Can't locate 'on' image '%1'")
- .arg(file));
- }
- }
- if (imgname.toLower() == "off")
- {
- image_off = ui->LoadScalePixmap(file);
- if (!image_off)
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- QString("Can't locate 'off' image '%1'")
- .arg(file));
- }
- }
- if (imgname.toLower() == "pushed")
- {
- image_pushed = ui->LoadScalePixmap(file);
-
- if (!image_pushed)
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- QString("Can't locate 'pushed' image '%1'")
- .arg(file));
- }
- }
- }
- else
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- QString("Unknown tag '%1' in selector")
- .arg(info.tagName()));
- return;
- }
- }
- }
-
- fontProp *testfont = GetFont(font);
- if (!testfont)
- {
- LOG(VB_GENERAL, LOG_WARNING, LOC +
- QString("Unknown font '%1' in selector '%2'")
- .arg(font).arg(name));
- return;
- }
-
- if (!image_on)
- image_on = new QPixmap();
- if (!image_off)
- image_off = new QPixmap();
- if (!image_pushed)
- image_pushed = new QPixmap();
-
- UISelectorType *st = new UISelectorType(name, *image_on, *image_off,
- *image_pushed, area);
-
- delete image_on;
- delete image_off;
- delete image_pushed;
-
- st->SetScreen(wmult, hmult);
- st->setPosition(area.topLeft());
- st->setFont(testfont);
- st->SetOrder(order.toInt());
- if (context != -1)
- {
- st->SetContext(context);
- }
- st->SetParent(container);
- st->calculateScreenArea();
- container->AddType(st);
-}
-
-
void XMLParse::parseBlackHole(LayerSet *container, QDomElement &element)
{
QRect area;
View
1  mythtv/libs/libmyth/xmlparse.h
@@ -38,7 +38,6 @@ class MPUBLIC XMLParse
void parsePushButton(LayerSet *, QDomElement &);
void parseTextButton(LayerSet *, QDomElement &);
void parseCheckBox(LayerSet *, QDomElement &);
- void parseSelector(LayerSet *, QDomElement &);
void parseBlackHole(LayerSet *, QDomElement &);
void parseListBtnArea(LayerSet *, QDomElement &);
void parseListTreeArea(LayerSet *, QDomElement &);
View
2  mythtv/libs/libmythbase/mythversion.h
@@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
-#define MYTH_BINARY_VERSION "0.25.20110816-1"
+#define MYTH_BINARY_VERSION "0.25.20110816-2"
/** \brief Increment this whenever the MythTV network protocol changes.
*
Please sign in to comment.
Something went wrong with that request. Please try again.