Ejemplo n.º 1
0
MainWindow::MainWindow( SysTray* _systray, QWidget* parent )
  : KXmlGuiWindow(parent, Qt::Window ),
  systray(_systray)
{
  move( Settings::self()->getPosition() );
  resize( Settings::self()->getSize() );
  
  Settings::self();
  configDialog = 0;
  setupGui();
  if( !Settings::self()->getStartInTray() && !Settings::self()->getAlwaysStartInTray() ){
    show();
  }
  
  curDate = new QDate(QDate::currentDate());
  dateCheckTimer = startTimer(60*1000);
  
  model->resetAllTodo( Settings::self()->getTodoList() );
  view->expandAll();
  todosChanged();
  connect( model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(expandSections(QModelIndex,QModelIndex)) );
  connect( model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(todosChanged()) );
  connect( Settings::self(), SIGNAL(sigConfigChanged()), this, SLOT(configChanged()) );
}
Ejemplo n.º 2
0
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
    displayTimer = new QTimer();
    displayTimer->setInterval(1000);
    connect(displayTimer,SIGNAL(timeout()),this,SLOT(onDisplayTime()));
    displayTimer->start();
    updateSocket = new QUdpSocket();
    updateSocket->bind(UDP_UPDATE_LINSTEN_PORT,QUdpSocket::ShareAddress);
    connect(updateSocket,SIGNAL(readyRead()),this,SLOT(onUpdateUdpRead()));
    file.setFileName(UPDATE_TEMP_FILE_NAME);
    fileManager = new FileManager;
    cmdSocket = new QUdpSocket();
    cmdSocket->bind(UDP_CMD_LINSTEN_PORT,QUdpSocket::ShareAddress);
    connect(cmdSocket,SIGNAL(readyRead()),this,SLOT(onCmdUdpRead()));

//    serialManager = new SerialManager;

//    form0_welcome = new FormWelcome;
//    form1_account = new FormLicense;
    form2_main = new FormMain;
    form3_vibrationAdjust = new FormVibrationAdjust;
    form4_mode = new FormModeSelect;
    form5_accuracy = new FormAccuracyAdjust;
//    form6_system = new FormSystem;
//    form7_shutdown = new FormShutdown;
//    form8_admin = new FormAdmin;
//    form9_ash = new FormAshClean;
//    form10_bkg = new FormCCDCurve;
//    form11_valve = new FormValveTest;
//    form12_accuracyDetail = new FormAccuracyDetailAdjust;
//    form13_whole = new FormWholeSetting;
//    form14_monitor = new FormCntCheck;
    form15_all = new FormAll;

//    connect(form0_welcome,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form1_account,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
    connect(form2_main,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
    connect(form3_vibrationAdjust,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
    connect(form4_mode,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
    connect(form5_accuracy,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form6_system,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form7_shutdown,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form8_admin,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form9_ash,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form10_bkg,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form11_valve,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form12_accuracyDetail,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form13_whole,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(form14_monitor,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));
//    connect(fileManager,SIGNAL(switchToPage(int)),ui->stackedWidget,SLOT(setCurrentIndex(int)));

    connect(fileManager,SIGNAL(sigConfigChanged()),form3_vibrationAdjust,SLOT(updateData()));
    connect(fileManager,SIGNAL(sigConfigChanged()),form4_mode,SLOT(updateData()));
//    connect(fileManager,SIGNAL(sigConfigChanged()),form9_ash,SLOT(updateData()));
//    connect(fileManager,SIGNAL(sigConfigChanged()),form10_bkg,SLOT(updateData()));
//    connect(fileManager,SIGNAL(sigConfigChanged()),form11_valve,SLOT(updateData()));
//    connect(fileManager,SIGNAL(sigConfigChanged()),form12_accuracyDetail,SLOT(updateData()));
//    connect(fileManager,SIGNAL(sigConfigChanged()),form13_whole,SLOT(updateData()));

//    connect(serialManager,SIGNAL(cleanAshRequire()),form9_ash,SLOT(autoCleanAsh()));
//    connect(serialManager,SIGNAL(updateCCD(QByteArray)),form10_bkg,SLOT(updateCCD(QByteArray)));
//    connect(serialManager,SIGNAL(cntUpload(int,int,int)),form14_monitor,SLOT(cntUpload(int,int,int)));
//    connect(serialManager,SIGNAL(resetSuccess()),form14_monitor,SLOT(resetSuccess()));

    ui->stackedWidget->insertWidget(0,form15_all);
//    ui->stackedWidget->insertWidget(0,form14_monitor);
//    ui->stackedWidget->insertWidget(0,form13_whole);
//    ui->stackedWidget->insertWidget(0,form12_accuracyDetail);
//    ui->stackedWidget->insertWidget(0,form11_valve);
//    ui->stackedWidget->insertWidget(0,form10_bkg);
//    ui->stackedWidget->insertWidget(0,form9_ash);
//    ui->stackedWidget->insertWidget(0,form8_admin);
//    ui->stackedWidget->insertWidget(0,form7_shutdown);
//    ui->stackedWidget->insertWidget(0,form6_system);
    ui->stackedWidget->insertWidget(0,form5_accuracy);
    ui->stackedWidget->insertWidget(0,form4_mode);
    ui->stackedWidget->insertWidget(0,form3_vibrationAdjust);
    ui->stackedWidget->insertWidget(0,form2_main);
//    ui->stackedWidget->insertWidget(0,form1_account);
//    ui->stackedWidget->insertWidget(0,form0_welcome);
    ui->stackedWidget->setCurrentIndex(0);
    cmdBuf.clear();
}