Пример #1
0
void SeafileTrayIcon::createActions()
{
    disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this);
    connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync()));

    enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this);
    connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync()));

    quit_action_ = new QAction(tr("&Quit"), this);
    connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile()));

    toggle_main_window_action_ = new QAction(tr("Show main window"), this);
    connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow()));

    settings_action_ = new QAction(tr("Settings"), this);
    connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow()));

    about_action_ = new QAction(tr("&About"), this);
    about_action_->setStatusTip(tr("Show the application's About box"));
    connect(about_action_, SIGNAL(triggered()), this, SLOT(about()));

    open_help_action_ = new QAction(tr("&Online help"), this);
    open_help_action_->setStatusTip(tr("open seafile online help"));
    connect(open_help_action_, SIGNAL(triggered()), this, SLOT(openHelp()));
}
Пример #2
0
void SeafileTrayIcon::createActions()
{
    disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this);
    connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync()));

    enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this);
    connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync()));

    view_unread_seahub_notifications_action_ = new QAction(tr("View unread notifications"), this);
    connect(view_unread_seahub_notifications_action_, SIGNAL(triggered()),
            this, SLOT(viewUnreadNotifications()));

    quit_action_ = new QAction(tr("&Quit"), this);
    connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile()));

    toggle_main_window_action_ = new QAction(tr("Show main window"), this);
    connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow()));

    settings_action_ = new QAction(tr("Settings"), this);
    connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow()));

    open_log_directory_action_ = new QAction(tr("Open &logs folder"), this);
    open_log_directory_action_->setStatusTip(tr("open seafile log directory"));
    connect(open_log_directory_action_, SIGNAL(triggered()), this, SLOT(openLogDirectory()));

    about_action_ = new QAction(tr("&About"), this);
    about_action_->setStatusTip(tr("Show the application's About box"));
    connect(about_action_, SIGNAL(triggered()), this, SLOT(about()));

    open_help_action_ = new QAction(tr("&Online help"), this);
    open_help_action_->setStatusTip(tr("open seafile online help"));
    connect(open_help_action_, SIGNAL(triggered()), this, SLOT(openHelp()));
}
Пример #3
0
/**
 * @brief Cosntructor.
 * Creates the design of the window.
 */
MainWindow::MainWindow(QWidget *parent) : QWidget(parent)
{
    m_app = qobject_cast<Application *>(qApp);
    setWindowTitle(m_app->getAppName());
    setFixedSize(800,600);
    m_mainLayout = new QVBoxLayout(this);
    m_hLayout = new QHBoxLayout;

    // m_leftPannel : list of movies or realisators or ...
    m_leftPannel = new QListWidget;
    fillLeftPannel();
    m_leftPannel->setMaximumWidth(this->width()*.3);

    // m_movieList : central list. Would be great to be able to choose how it looks like
    m_moviesList = new QTableView;
    fillMoviesList();
    m_moviesList->setShowGrid(false);
    m_moviesList->verticalHeader()->hide();
    m_moviesList->setAlternatingRowColors(true);

    m_settingsButton = new QPushButton("Settings");
    QObject::connect(m_settingsButton, SIGNAL(clicked()), this, SLOT(showSettingsWindow()));

    m_mainLayout->addWidget(m_settingsButton);
    m_mainLayout->addLayout(m_hLayout);
    m_hLayout->addWidget(m_leftPannel);
    m_hLayout->addWidget(m_moviesList);
}
Пример #4
0
void SeafileTrayIcon::createActions()
{
    disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this);
    connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync()));

    enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this);
    connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync()));

    quit_action_ = new QAction(tr("&Quit"), this);
    connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile()));

    toggle_main_window_action_ = new QAction(tr("Show main window"), this);
    connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow()));

    settings_action_ = new QAction(tr("Settings"), this);
    connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow()));
}
Пример #5
0
void SeafileTrayIcon::createActions()
{
    disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this);
    connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync()));

    enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this);
    connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync()));

    quit_action_ = new QAction(tr("&Quit"), this);
    connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile()));

    show_main_window_action_ = new QAction(tr("Show main window"), this);
    connect(show_main_window_action_, SIGNAL(triggered()), this, SLOT(showMainWindow()));

    settings_action_ = new QAction(tr("Settings"), this);
    connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow()));

    open_seafile_folder_action_ = new QAction(tr("Open %1 &folder").arg(getBrand()), this);
    open_seafile_folder_action_->setStatusTip(tr("open %1 folder").arg(getBrand()));
    connect(open_seafile_folder_action_, SIGNAL(triggered()), this, SLOT(openSeafileFolder()));

#if defined(Q_OS_WIN32)
    shellext_fix_action_ = new QAction(tr("Repair explorer extension"), this);
    connect(shellext_fix_action_, SIGNAL(triggered()), this, SLOT(shellExtFix()));
#endif
    open_log_directory_action_ = new QAction(tr("Open &logs folder"), this);
    open_log_directory_action_->setStatusTip(tr("open %1 log folder").arg(getBrand()));
    connect(open_log_directory_action_, SIGNAL(triggered()), this, SLOT(openLogDirectory()));

    upload_log_directory_action_ = new QAction(tr("Upload log files"), this);
    upload_log_directory_action_->setStatusTip(tr("upload %1 log files").arg(getBrand()));
    connect(upload_log_directory_action_, SIGNAL(triggered()), this, SLOT(uploadLogDirectory()));

    show_sync_errors_action_ = new QAction(tr("Show file sync errors"), this);
    show_sync_errors_action_->setStatusTip(tr("Show file sync errors"));
    connect(show_sync_errors_action_, SIGNAL(triggered()), this, SLOT(showSyncErrorsDialog()));

    about_action_ = new QAction(tr("&About"), this);
    about_action_->setStatusTip(tr("Show the application's About box"));
    connect(about_action_, SIGNAL(triggered()), this, SLOT(about()));

    open_help_action_ = new QAction(tr("&Online help"), this);
    open_help_action_->setStatusTip(tr("open %1 online help").arg(getBrand()));
    connect(open_help_action_, SIGNAL(triggered()), this, SLOT(openHelp()));
}
Пример #6
0
Profile::Profile(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Profile)
{
    ui->setupUi(this);

    QPixmap UserProfilePix("C:\\img\\damon.png");
    ui->lbl_ProfilePic->setPixmap(UserProfilePix);

    QPixmap Slot1Pix("C:\\img\\david.png");
    ui->lbl_FirstContactSlot->setPixmap(Slot1Pix);

    QPixmap Slot2Pix("C:\\img\\dom.png");
    ui->lbl_SecondContactSlot->setPixmap(Slot2Pix);

    QPixmap Slot3Pix("C:\\img\\trevor.png");
    ui->lbl_ThirdContactSlot->setPixmap(Slot3Pix);

    QPixmap Slot4Pix("C:\\img\\jesse.png");
    ui->lbl_FourthContactSlot->setPixmap(Slot4Pix);

    connect(ui->pushButton_SignOut, SIGNAL(clicked()), SLOT(hide()));
    connect(ui->pushButton_SignOut, SIGNAL(clicked()), SIGNAL(showLoginWindow()));

    connect(ui->pushButton_AdvancedSettings, SIGNAL(clicked()), SLOT(hide()));
    connect(ui->pushButton_AdvancedSettings, SIGNAL(clicked()), SIGNAL(showSettingsWindow()));

    connect(ui->button_changePass, SIGNAL(clicked()), SIGNAL(showChangePassWindow()));

    connect(ui->btn_changepicture, SIGNAL(clicked()), SIGNAL(showChangePictureWindow()));

    connect(ui->btn_addContact, SIGNAL(clicked()), SIGNAL(showNewContactWindow()));

    connect(ui->pushButton_CS1, SIGNAL(clicked()), SLOT(hide()));
    connect(ui->pushButton_CS1, SIGNAL(clicked()), SIGNAL(showChatWindow()));

    connect(ui->pushButton_CS2, SIGNAL(clicked()), SLOT(hide()));
    connect(ui->pushButton_CS2, SIGNAL(clicked()), SIGNAL(showChatWindow()));


}
Пример #7
0
UIManager::UIManager() {
    mainWindow = new MainWindow();
    mainMenu = new MainMenu(mainWindow);
    navigationWindow = new NavigationWindow(mainWindow);
    settingsWindow = new SettingsForm(mainWindow);

    mainWindow->layout()->addWidget(mainMenu);
    mainWindow->layout()->addWidget(navigationWindow);
    mainWindow->layout()->addWidget(settingsWindow);
    toolbox = new ToolBox(navigationWindow);

    QObject::connect(mainWindow, SIGNAL(geometryChanged(QRect)), this, SLOT(mainWindowGeometryChanged(QRect)));
    QObject::connect(navigationWindow, SIGNAL(goBack()), this, SLOT(showMainMenu()));
    QObject::connect(navigationWindow, SIGNAL(toolboxButtonClicked()), this, SLOT(toggleToolbox()));
    QObject::connect(mainMenu, SIGNAL(close()), this, SLOT(close()));
    QObject::connect(mainMenu, SIGNAL(showChart()), this, SLOT(showChartWindow()));
    QObject::connect(mainMenu, SIGNAL(showSettings()), this, SLOT(showSettingsWindow()));
    QObject::connect(settingsWindow, SIGNAL(goBack()), this, SLOT(showMainMenu()));

    connectInstruments();
    mainWindow->show();
}
Пример #8
0
/*
 * MainWindow to główne okno programu, znajdują sie w nim ...
 * Opis:
 *  Na początku tworzone są obiekty : 2 Joypady, którym nie są przypisane żadne joypady w systemie,
 *  Przypisać joypad można tylko raz wchodząc w settings window
 *
 *  W kolejnym kroku tworzone są timery które odliczają czas po którym następuje uaktualnienie stanu
 *  guzików i osi w każdym z joypadów,
 *  Joypad wykrywa, że jakaś oś/guzik uległa/uległ zmianie i emitują sygnały axisChanged, buttonChanged
 *
 *  Następnie tworzone są timery króre po przepełnieniu uaktywniają wysłanie danych przez sieć do manipulatora
 *  i Łazika
 *
 *  Następnie tworzone są obiekty Manipulaotra i Łazika dziedzicące po ModbusClient, które interpretują komendy
 *  z joypadów, obiekty te odpowiedzalne są również za połączenie.
 *
 *  Następnie łączone są sygnały z settingsWindow które uaktywniają połączenie, oraz wyświetlają jego status
 *
 *  Następnie łączone są sygnały zmiany osi/przycisku z elementami w UI odpowiedzialnymi za wyświetlanie stanu
 *  joypada
 *
 */
MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
{
  myJoystickRover = new QJoystick(this);
  myJoystickManipulator = new QJoystick(this);

  //Timer for refreshing joypadData inside this program
  joypadRoverRefresh = new QTimer(this);
  joypadManipulatorRefresh = new QTimer(this);
  connect(joypadRoverRefresh,SIGNAL(timeout()),myJoystickRover,SLOT(getData()));
  connect(joypadManipulatorRefresh,SIGNAL(timeout()),myJoystickManipulator,SLOT(getData()));

  //Timer to send data to rover and manipulator
  roverRefresh = new QTimer(this);
  manipulatorRefresh = new QTimer(this);

  mySettingsWindow = new SettingsWindow();

  ui->setupUi(this);

  //Manipulator and rover objects that inherits from ModbusServer
  myRover = new Rover(this);
  myManipulator = new Manipulator(this);

  //Rover
  connect(this->mySettingsWindow,SIGNAL(roverJoypadSelected(int)),this,SLOT(createRoverJoystick(int)));
  connect(this->myRover,SIGNAL(statusConnectedChanged(bool)),this->mySettingsWindow,SLOT(setStatusDiodeRover(bool)));
  connect(this->mySettingsWindow,SIGNAL(connectToHostRover(QString,int)),this,SLOT(connectToHostRover(QString,int)));
  connect(this->mySettingsWindow,SIGNAL(disconnectFromHostRover()),this,SLOT(disconnectFromHostRover()));

  //Manipulator
  connect(this->mySettingsWindow,SIGNAL(manipulatorJoypadSelected(int)),this,SLOT(createManipulatorJoystick(int)));
  connect(this->myManipulator,SIGNAL(statusConnectedChanged(bool)),this->mySettingsWindow,SLOT(setStatusDiodeManipulator(bool)));
  connect(this->mySettingsWindow,SIGNAL(connectToHostManipulator(QString,int)),this,SLOT(connectToHostManipulator(QString,int)));
  connect(this->mySettingsWindow,SIGNAL(disconnectFromHostManipulator()),this,SLOT(disconnectFromHostManipulator()));

  //Open settings window
  connect(this->ui->actionSettings,SIGNAL(triggered()),this,SLOT(showSettingsWindow()));

  //Show data on joypadRoverWidget
  connect(myJoystickRover,SIGNAL(axisChanged(int,qint16)),this->ui->widgetJoypadRover,SLOT(changeAxisStat(int,qint16)));
  connect(myJoystickRover,SIGNAL(buttonChanged(int,bool)),this->ui->widgetJoypadRover,SLOT(changeButtonState(int,bool)));

  //Show data on joypadRoverWidget (temp rover, couse we will have different graphics)
  connect(myJoystickManipulator,SIGNAL(axisChanged(int,qint16)),this->ui->widgetJoypadRover,SLOT(changeAxisStat(int,qint16)));
  connect(myJoystickManipulator,SIGNAL(buttonChanged(int, bool)),this->ui->widgetJoypadRover,SLOT(changeButtonState(int,bool)));

  //Rover sending over modbus interval
  roverRefresh = new QTimer(this);
  connect(roverRefresh,SIGNAL(timeout()),myRover,SLOT(sendRoverData()));

  //Manipulator sending over modbus interval
  manipulatorRefresh = new QTimer(this);
  connect(manipulatorRefresh,SIGNAL(timeout()),myManipulator,SLOT(sendManipulatorData()));

  //Send data about changed Axis/Button state from joypad to Rover
  connect(myJoystickRover,SIGNAL(axisChanged(int,qint16)),myRover,SLOT(interpretJoypadAxis(int,qint16)));
  connect(myJoystickRover,SIGNAL(buttonChanged(int,bool)),myRover,SLOT(interpretJoypadButton(int,bool)));

  //Send data about changed Axis/Button state from joypad to Manipulator
  connect(myJoystickManipulator,SIGNAL(axisChanged(int,qint16)),myManipulator,SLOT(interpretJoypadAxis(int,qint16)));
  connect(myJoystickManipulator,SIGNAL(buttonChanged(int,bool)),myManipulator,SLOT(interpretJoypadButton(int,bool)));

}