Ejemplo n.º 1
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    CBResource.contextCBActivity = this;

    mIsValidDevice = CBValidityChecker.isValid(CBActivity.this);

    mGridViewActivityIntent = new Intent();
    mGridViewActivityIntent.setClass(CBActivity.this, GridViewActivity.class);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_manage);

    InitAsyncTask initTask = new InitAsyncTask();
    initTask.execute((Object) null);

    mButtonNewOrder = (CBDialogButton) this.findViewById(R.id.button_newOrder);
    mButtonNewOrder.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            if (mIsValidDevice == false) {
              showValidateCheckingFailedDialog();
              return;
            }

            showOrderPrepareDialog();
          }
        });

    mButtonOrdersList = (CBDialogButton) this.findViewById(R.id.button_ordersList);
    mButtonOrdersList.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            if (mIsValidDevice == false) {
              showValidateCheckingFailedDialog();
              return;
            }

            showOrderedListDialog();
          }
        });

    mButtonQuit = (CBDialogButton) this.findViewById(R.id.button_quit);
    mButtonQuit.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            showQuitingDialog();
          }
        });

    if (CBTrialCtrl.isTrialVersion()) CBTrialCtrl.showTrialWarningDialog(this);
  }
Ejemplo n.º 2
0
  private CBMenuEngine initMenuEngine() {

    CBMenuItemsSet set = null;

    if (CBTrialCtrl.isTrialVersion() == false) {
      CBDishesScanner scanner =
          new CBDishesScanner(CBSettings.getStringValue(CBSettings.CB_SETTINGS_SOURCE_DIR_DISHES));
      set = scanner.scan();
    } else {
      set = CBTrialCtrl.loadTrialDishes(this);
    }

    CBBitmapFactory.setMenuItemsSetIcons(set, this);
    CBResource.menuEngine = new CBMenuEngine();
    CBResource.menuEngine.setMenuSet(set);

    return CBResource.menuEngine;
  }
Ejemplo n.º 3
0
  public void showQuitingDialog() {
    ConfirmDialog confirmDialog = new ConfirmDialog(this);
    confirmDialog.setTitle(R.string.confirm_dialog_title_warning);
    confirmDialog.setMessage(R.string.warning_quiting);

    confirmDialog.setCallback(
        new ConfirmDialog.Callback() {
          public void onConfirm() {
            finishCBActivity();
          }

          public void onCancel() {}
        });

    confirmDialog.show();

    if (CBTrialCtrl.isTrialVersion()) {
      CBTrialCtrl.showTrialWarningDialog(this);
    }
  }
Ejemplo n.º 4
0
 private void finishCBActivity() {
   if (CBTrialCtrl.isTrialVersion() == false) CBSettings.save();
   finish();
 }