Exemple #1
0
int menu::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: foodshowFullScreen(); break;
        case 1: shopshowFullScreen(); break;
        case 2: entshowFullScreen(); break;
        case 3: fmshowFullScreen(); break;
        case 4: fushowFullScreen(); break;
        case 5: otshowFullScreen(); break;
        case 6: go(); break;
        case 7: canc(); break;
        case 8: max_click(); break;
        case 9: check_save(); break;
        case 10: ex(); break;
        case 11: ba(); break;
        case 12: mor(); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}
void Scope::ActivatePreviewAction(Preview::ActionPtr const& action,
                                  LocalResult const& result,
                                  glib::HintsMap const& hints,
                                  ActivateCallback const& callback,
                                  GCancellable* cancellable)
{
  if (!action)
    return;

  if (!action->activation_uri.empty())
  {
    LocalResult preview_result;
    preview_result.uri = action->activation_uri;

    LOG_DEBUG(logger) << "Local Activation '" << result.uri;

    // Do the activation on idle.
    glib::Object<GCancellable> canc(cancellable, glib::AddRef());
    pimpl->sources_.AddIdle([this, preview_result, callback, canc] ()
    {
      if (!canc || !g_cancellable_is_cancelled(canc))
      {

        if (callback)
          callback(preview_result, ScopeHandledType::NOT_HANDLED, glib::Error());
        pimpl->OnActivateResultReply(preview_result, ScopeHandledType::NOT_HANDLED, glib::HintsMap(), glib::Error());
      }
      return false;
    });
    return;
  }

  glib::HintsMap tmp_hints = hints;
  tmp_hints["preview-action-id"] = action->id;
  pimpl->Activate(result, UNITY_PROTOCOL_ACTION_TYPE_PREVIEW_ACTION, tmp_hints, callback, cancellable);
}
Exemple #3
0
menu::menu(QWidget *parent) :
    QWidget(parent),expend(),dab()

{
    this->setStyleSheet("background-color:black");
    QFont newff("Arial",10,QFont::Normal,false);
     QFont newfb("Arial",8,0,false);
    // QFont newfc("Arial",8,0,false);
     maxexp=new QPushButton("Reset your maximum expenditure limit",this);
     maxexp->setStyleSheet("background-color:#003333;color:white");
     maxexp->setFont(newfb);
     exitt=new QPushButton("Exit",this);
     exitt->setStyleSheet("background-color:#003333;color:white");
     exitt->setFont(newff);

     more=new QPushButton("More options",this);
     more->setStyleSheet("background-color:#003333;color:white");
     more->setFont(newff);



     bacc=new QPushButton("Back",this);
     bacc->setStyleSheet("background-color:#003333;color:white");
     bacc->setFont(newff);


     cancel=new QPushButton("Cancel",this);
     cancel->setStyleSheet("background-color:#003333;color:white");
     cancel->setFont(newff);
     cancel->setVisible(false);

     max=new QLineEdit("",this);
     max->setStyleSheet("background-color:white;color:black");
     max->setVisible(false);
     ok=new QPushButton("OK",this);
     ok->setVisible(false);
    ok->setStyleSheet("background-color:#003333;color:white");
    ok->setFont(newff);

     maxexp->setStyleSheet("background-color:#003333;color:white");
     maxexp->setFont(newff);
     hb4=new QHBoxLayout();

    vb1=new QVBoxLayout(this);

    hb=new QHBoxLayout();
    hb1=new QHBoxLayout();
     hb2=new QHBoxLayout();
      hb3=new QHBoxLayout();
      hb5=new QHBoxLayout();


     //select=new QLabel("<img src='D:/Desert.JPG'/ >",this);
       select=new QLabel("   Choose your category ",this);

       select->setStyleSheet("background-color:black;color:white; qproperty-alignment: AlignCenter");

       select->setAlignment(Qt::AlignTop);



       select->setMaximumHeight(45);
       select->setFont(newff);

       check=new QPushButton("Click to check total savings",this);
       check->setStyleSheet("background-color:#003333;color:white");

       check->setFont(newff);



    food=new QPushButton("food",this);
    food->setStyleSheet("background-color:#003333;color:white");
    food->setFixedSize(180,40);
    food->setFont(newff);

    shopping=new QPushButton("shopping",this);
    shopping->setFixedSize(180,40);
    shopping->setStyleSheet("background-color:#003333;color:white");
    shopping->setFont(newff);

    entertainment=new QPushButton("entertainment",this);
    entertainment->setStyleSheet("background-color:#003333;color:white");
    entertainment->setFixedSize(180,40);
    entertainment->setFont(newfb);

    family=new QPushButton("family/friends",this);
    family->setStyleSheet("background-color:#003333;color:white");
    family->setFixedSize(180,40);
    family->setFont(newff);

    fuel=new QPushButton("fuel",this);
    fuel->setStyleSheet("background-color:#003333;color:white");
    fuel->setFixedSize(180,40);
    fuel->setFont(newff);

    others=new QPushButton("others",this);
    others->setStyleSheet("background-color:#003333;color:white");
    others->setFixedSize(180,40);
 others->setFont(newff);

hb5->addWidget(check);
hb4->addWidget(max);
hb4->addWidget(ok);
hb4->addWidget(cancel);

   hb1->addWidget(food);
   hb1->addWidget(shopping);

   hb2->addWidget(entertainment);
   hb2->addWidget(family);

   hb3->addWidget(fuel);
   hb3->addWidget(others);
   vb1->addItem(hb5);
   vb1->addWidget(maxexp);

   vb1->addItem(hb4);
   vb1->addWidget(more);
   vb1->addWidget(select);

   vb1->addItem(hb1);
   vb1->addItem(hb2);
   vb1->addItem(hb3);
    vb1->addWidget(exitt);
    vb1->addWidget(bacc);



   QObject::connect(food,SIGNAL(clicked()),this,SLOT(foodshowFullScreen()));
   QObject::connect(shopping,SIGNAL(clicked()),this,SLOT(shopshowFullScreen()));
   QObject::connect(entertainment,SIGNAL(clicked()),this,SLOT(entshowFullScreen()));
   QObject::connect(family,SIGNAL(clicked()),this,SLOT(fmshowFullScreen()));
   QObject::connect(fuel,SIGNAL(clicked()),this,SLOT(fushowFullScreen()));
   QObject::connect(others,SIGNAL(clicked()),this,SLOT(otshowFullScreen()));
   QObject::connect(ok,SIGNAL(clicked()),this,SLOT(go()));
   QObject::connect(cancel,SIGNAL(clicked()),this,SLOT(canc()));
   QObject::connect(maxexp,SIGNAL(clicked()),this,SLOT(max_click()));
   QObject::connect(check,SIGNAL(clicked()),this,SLOT(check_save()));
   QObject::connect(exitt,SIGNAL(clicked()),this,SLOT(ex()));
   QObject::connect(bacc,SIGNAL(clicked()),this,SLOT(ba()));
   QObject::connect(more,SIGNAL(clicked()),this,SLOT(mor()));








}