Beispiel #1
0
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    trayIcon = new QSystemTrayIcon(this);

    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    connect(ui->exit_button, SIGNAL(clicked(bool)),qApp,SLOT(quit()));


    trayIcon->setIcon(QIcon(":image/bad.png"));
    trayIcon->show();
    trayIcon->showMessage(QTime::currentTime().toString(),"Time over!");

    time = new QTime();

    //ui->tableView->setVerticalHeader("Hello");
    //ui->tableView->setRowCount(10);
    //ui->tableView->setColumnCount(3);
    //ui->tableView->set
    const int WDGT_WIDTH = 271;
    ui->tableWidget->setColumnWidth(0,WDGT_WIDTH/3);
    ui->tableWidget->setColumnWidth(1,WDGT_WIDTH/3);
    ui->tableWidget->setColumnWidth(2,WDGT_WIDTH/3);
}
Beispiel #2
0
Window::Window()
{
    QDialog::setWindowFlags(Qt::WindowStaysOnTopHint| Qt::WindowCloseButtonHint | Qt::Tool);

    stop = false;
    createMessageGroupBox();

    createActions();
    createTrayIcon();

    connect(StartButton, SIGNAL(clicked()), this, SLOT(startPing()));
    connect(StopButton, SIGNAL(clicked()), this, SLOT(stopPing()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
               this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(messageGroupBox);
    setLayout(mainLayout);
    setWindowTitle(tr("Pinger v.1.2"));
    resize(215, 100);

    QIcon icon = QIcon(":/images/trash.svg");
    trayIcon->setIcon(icon);
    setWindowIcon(icon);
    trayIcon->show();
    trayIcon->setToolTip(tr("Pinger v.1.2"));

    setVisible(true);
}
Beispiel #3
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: displayError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
        case 1: connectedChannel(); break;
        case 2: disconnectedChannel(); break;
        case 3: readTxChannel(); break;
        case 4: readRxChannel(); break;
        case 5: refreshCount(); break;
        case 6: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 7: setIcon((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: save(); break;
        case 9: start(); break;
        case 10: stop(); break;
        case 11: install(); break;
        case 12: uninstall(); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}
DistributorDialog::DistributorDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DistributorDialog)
{
    ui->setupUi(this);

    QString appData(getenv("APPDATA"));
    dataFileName = appData.append("\\FileDistributor\\settings.dat");
    copier = new Copier();
    copier->moveToThread(&workerThread);
    dirsModel = new QStringListModel(copier->getDestDirs(), this);

    load();
    icon = new QSystemTrayIcon(QIcon(":/res/FD.ico"), this);
    iconMenu = new QMenu(this);
    iconMenu->addAction("Settings", this, SLOT(show()));
    iconMenu->addSeparator();
    iconMenu->addAction("Close", this, SLOT(quit()));
    icon->setContextMenu(iconMenu);
    icon->show();
    displayMessage("", "FileDistributor is running");
    timer = new QTimer(this);

    connect(icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
    connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(save()));
    connect(ui->sourceDirBrowse, SIGNAL(clicked()), this, SLOT(browse()));
    connect(ui->addDirB, SIGNAL(clicked()), this, SLOT(addDest()));
    connect(ui->removeDirB, SIGNAL(clicked()), this, SLOT(removeDest()));
    connect(timer, SIGNAL(timeout()), copier, SLOT(startCopy()));
    connect(this, SIGNAL(startCopy()), copier, SLOT(startCopy()));
    connect(copier, SIGNAL(copyStarted()), this, SLOT(copyStarted()));
    workerThread.start();
    emit startCopy();
    timer->start(1000*copier->getRefreshRateSeconds());
}
Window::Window()
    : m_icon(":/images/justlock.png"), m_logFiles(),  m_logStreams(), m_fileWatcher(0),
      m_maxRows(5), m_rowCount(0), m_warningIcon(":/images/trianglewarning.png")
{
    loadPreferences(true);
    createLogWidgets();
    createActions();
    createTrayIcon();
    createMenus();
    QWidget *widget = new QWidget();
    widget->setLayout(m_topLayout);
    setCentralWidget(widget);

    createRegexps();

    // setup the tray icon
    trayIcon->setToolTip(tr("Shows the status of DNSSEC Requests on the system"));
    trayIcon->setIcon(m_icon);
    setWindowIcon(m_icon);

    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));


    trayIcon->show();

    setWindowTitle(tr("DNSSEC Log Messages"));
}
Beispiel #6
0
void ATMainWindow_c::createTrayIcon()
{
	QAction *aboutAction = new QAction(tr("&About..."), this);
	ATVERIFY( connect(aboutAction, SIGNAL(triggered()), this, SLOT(slotShowAbout())) );

	QAction *restoreAction = new QAction(tr("&Restore"), this);
	ATVERIFY( connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())) );

	QAction *quitAction = new QAction(tr("&Quit"), this);
	ATVERIFY( connect(quitAction, SIGNAL(triggered()), this, SLOT(slotTentativeQuit())) );

	m_trayIconMenu = new QMenu( this );
	m_trayIconMenu->addAction(aboutAction);
	m_trayIconMenu->addAction(restoreAction);
	m_trayIconMenu->addAction(quitAction);

	m_trayIcon = new QSystemTrayIcon( this );
	m_trayIcon->setContextMenu( m_trayIconMenu );
	m_trayIcon->setIcon( m_iconDisconnected );
	m_trayIcon->show();

	ATVERIFY( connect( m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
		this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))) );

	ATVERIFY( connect(m_pMainWindow, SIGNAL(signalSetTrayIcon(int)), this, SLOT(slotSetTrayIcon(int))) );
}
Beispiel #7
0
void widget::createSystemTrayIcon()
{
    trayIcon = new QSystemTrayIcon(this);
    trayIcon->setIcon(QIcon(tr(":/images/myIcon.ico")));
    trayIcon->setToolTip("阁楼音乐 - 音乐播放器");

    restoreAction = new QAction(tr("打开主面板"), this);
    connect(restoreAction, SIGNAL(triggered()), this, SLOT(show()));

    quitAction=new QAction(tr("退出"), this);
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));

    trayContextMenu=new QMenu(this);
    playModeMenu->setTitle("播放模式");
    trayContextMenu->addMenu(playModeMenu);
    trayContextMenu->addSeparator();
    trayContextMenu->addAction(ui->action_About);
    trayContextMenu->addSeparator();
    trayContextMenu->addAction(restoreAction);
    trayContextMenu->addAction(quitAction);
    trayIcon->setContextMenu(trayContextMenu);

    trayIcon->show();
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), \
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #8
0
void Window::createTrayIcon()
{
    tray = new CustomTrayIcon(this);
    setWindowIcon(tray->icon());
    connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #9
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    lastChanged(false), lastNetworkChanged(true)
{
    ui->setupUi(this);

    createActions();
    createTrayIcon();

    statusLabel = new QLabel(this);
    ui->statusBar->addWidget(statusLabel, 1);

    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    connect(&arpWatcher, SIGNAL(routeUpdated()), this,
            SLOT(routeUpdated()));
    connect(&arpWatcher, SIGNAL(networkChanged(bool)), this,
            SLOT(networkChanged(bool)));
    connect(&arpWatcher, SIGNAL(changeDetected(bool)), this,
            SLOT(changeDetected(bool)));
    connect(&arpWatcher, SIGNAL(newCheck(QString,QString,QString)),
            this, SLOT(newCheck(QString,QString,QString)));

    setIcon("trash", QApplication::applicationName());

    trayIcon->show();

    /* To show the set-up on start */
    routeUpdated();

    arpWatcher.start();
}
Beispiel #10
0
MainWidget::MainWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MainWidget),
    ts(new RectSelector),
    maximizedState(false)
{
    ui->setupUi(this);

    QVector<QPushButton*> modeButtons;
    modeButtons.push_back(ui->mode0Button);
    modeButtons.push_back(ui->mode1Button);
    modeBox = new ModeBox(modeButtons);

    createActions();
    createTrayIcon();
    windowVisibility = true;

    loadSettings();
    //storePositionInfo();

    connect(this, SIGNAL(setPixmap(QPixmap)), ts, SLOT(loadBackgroundPixmap(QPixmap)));
    connect(ts, SIGNAL(finishPixmap(QPixmap)), this, SLOT(triangleReceiver(QPixmap)));
    connect(ts, SIGNAL(quitPixmap()), this, SLOT(triangleReceiver()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    shootFullScreen();
    updateScreenshotLabel();
}
Beispiel #11
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    d(new MainWindow_private(this))
{
    g_pMainGuiWindow = this;
    //createDockWindows();
    createActions();
    createMenus();
    //createToolBars();
    //createStatusBar();
    setCentralWidget(d->m_canvasWidget);
#ifdef DEBUG
    setWindowTitle(QString(APPLICATION_NAME) + "-" + QString(APP_FULL_VERSION_TAG) + " (" + QString(APP_DATE) +")");
#else
    setWindowTitle(QString(APPLICATION_NAME) + "-" + QString(APP_SHORT_VERSION_TAG));
#endif //DEBUG

    setWindowIcon(QIcon(":/icons/semaphored.svg"));

    d->m_pTrayIcon = new QSystemTrayIcon(QIcon(":/icons/semaphored.svg"),this);
    connect(this, SIGNAL(signalPlaceToTray()),this, SLOT(slotPlaceToTray()),Qt::QueuedConnection);
    connect(d->m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
    d->m_pTrayIcon->show();
}
QMainWindowTray::QMainWindowTray(QWidget *parent) :
    QMainWindow(parent)
  , icon_online(QIcon (":/resources/icon-online.svg"))
  , icon_offline(QIcon (":/resources/icon-offline.svg"))
  , icon_unread(QIcon (":/resources/icon-unread.svg"))
{
#if not __ANDROID__
    if (QSystemTrayIcon::isSystemTrayAvailable()) {

        createActions();
        createTrayIcon();
        setMainWindowIcon();

        connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

        trayIcon->setIcon(QIcon(":/resources/icon-offline.svg"));
        trayIcon->setToolTip(tr("Vcrypt messanger"));
        trayIcon->show();
    }

    qDebug() << "windows state: " << 0 + windowState();
#endif
}
Beispiel #13
0
int Buddies::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: countOnlineUsers(); break;
        case 1: setUserStatus(); break;
        case 2: loginUser(); break;
        case 3: loginCurrentStatus(); break;
        case 4: validateUser(); break;
        case 5: stopifNotConnected(); break;
        case 6: myexit(); break;
        case 7: focusTabEdit(); break;
        case 8: structUser(); break;
        case 9: startChat(); break;
        case 10: helpAbout(); break;
        case 11: getSysInfo(); break;
        case 12: onlineNotify(); break;
        case 13: WriteOnWall(); break;
        case 14: Information(); break;
        case 15: dbstatus(); break;
        case 16: openNotes(); break;
        case 17: setIcon((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 18: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 19: messageClicked(); break;
        case 20: showMessage(); break;
        }
        _id -= 21;
    }
    return _id;
}
Beispiel #14
0
//! [0]
Window::Window()
{
    createIconGroupBox();
    createMessageGroupBox();

    iconLabel->setMinimumWidth(durationLabel->sizeHint().width());

    createActions();
    createTrayIcon();

    connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
    connect(showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
    connect(iconComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int)));
    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(iconGroupBox);
    mainLayout->addWidget(messageGroupBox);
    setLayout(mainLayout);

    iconComboBox->setCurrentIndex(1);
    trayIcon->show();

    setWindowTitle(tr("Systray"));
    resize(400, 300);
}
Beispiel #15
0
Systray::Systray(QObject *parent) : QObject(parent)
{
    s.setEmptyToDefaults();

    createActions();
    createTrayIcon();

    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon,
            SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
            SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    setTrayIcon(":/images/puush-qt.png");

    trayIcon->show();

    trayIcon->setToolTip("puush-qt");

    history = new History();

    connect(history,
            SIGNAL(historyDone(QList<ApiHist::HistData>)), this,
            SLOT(updateHistoryMenu(QList<ApiHist::HistData>)));

    // Get the history after the app starts. For some reason the context
    // menu hangs when getting the history, even though it's asynchronous.
    // So just call it soon (waiting for wifi or something to come up after starting on boot...).
    updateHistoryAfterTimeout();
}
Beispiel #16
0
int Widget::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: mySignal(); break;
        case 1: on_toolButton_List_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: tableWidget_cellDoubleClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: on_toolButton_lrcD_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: on_toolButton_next_clicked(); break;
        case 5: on_toolButton_stop_clicked(); break;
        case 6: on_toolButton_playpause_clicked(); break;
        case 7: on_toolButton_previous_clicked(); break;
        case 8: on_toolButton_open_clicked(); break;
        case 9: showTime((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 10: Timeout(); break;
        case 11: musicInformationStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 12: mediaObjectStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 13: musicAboutToFinish(); break;
        case 14: currentMusicSourceChanged((*reinterpret_cast< Phonon::MediaSource(*)>(_a[1]))); break;
        case 15: removeSlot(); break;
        case 16: exitSlot(); break;
        case 17: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
Beispiel #17
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->initGlobaShortcut();
    trayIcon = new QSystemTrayIcon(this);

    createActions();
    createTrayIcon();

    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));



    QIcon icon = QIcon(":/images/icon.svg");

    trayIcon->setIcon(icon);
    trayIcon->show();

    this->setWindowIcon(icon);
    setWindowTitle(trUtf8("quteNote"));

    this->setTreeNode();

    QSet<QString> set;
}
Beispiel #18
0
void radeon_profile::setupTrayIcon() {
    trayMenu = new QMenu(this);
    setWindowState(Qt::WindowMinimized);
    //close //
    closeApp = new QAction(trayMenu);
    closeApp->setText(tr("Quit"));
    connect(closeApp,SIGNAL(triggered()),this,SLOT(closeFromTray()));

    // standard profiles
    changeProfile = new QAction(trayMenu);
    changeProfile->setText(tr("Change standard profile"));
    connect(changeProfile,SIGNAL(triggered()),this,SLOT(on_chProfile_clicked()));

    // refresh when hidden
    refreshWhenHidden = new QAction(trayMenu);
    refreshWhenHidden->setCheckable(true);
    refreshWhenHidden->setChecked(true);
    refreshWhenHidden->setText(tr("Keep refreshing when hidden"));

    // dpm menu //
    dpmMenu = new QMenu(this);
    dpmMenu->setTitle(tr("DPM"));

    dpmSetBattery = new QAction(dpmMenu);
    dpmSetBalanced = new QAction(dpmMenu);
    dpmSetPerformance = new QAction(dpmMenu);

    dpmSetBattery->setText(tr("Battery"));
    dpmSetBattery->setIcon(QIcon(":/icon/symbols/arrow1.png"));
    dpmSetBalanced->setText(tr("Balanced"));
    dpmSetBalanced->setIcon(QIcon(":/icon/symbols/arrow2.png"));
    dpmSetPerformance->setText(tr("Performance"));
    dpmSetPerformance->setIcon(QIcon(":/icon/symbols/arrow3.png"));

    connect(dpmSetBattery,SIGNAL(triggered()),this,SLOT(on_btn_dpmBattery_clicked()));
    connect(dpmSetBalanced,SIGNAL(triggered()),this, SLOT(on_btn_dpmBalanced_clicked()));
    connect(dpmSetPerformance,SIGNAL(triggered()),this,SLOT(on_btn_dpmPerformance_clicked()));

    dpmMenu->addAction(dpmSetBattery);
    dpmMenu->addAction(dpmSetBalanced);
    dpmMenu->addAction(dpmSetPerformance);
    dpmMenu->addSeparator();
    dpmMenu->addMenu(forcePowerMenu);

    // add stuff above to menu //
    trayMenu->addAction(refreshWhenHidden);
    trayMenu->addSeparator();
    trayMenu->addAction(changeProfile);
    trayMenu->addMenu(dpmMenu);
    trayMenu->addSeparator();
    trayMenu->addAction(closeApp);

    // setup icon finally //
    QIcon appicon(":/icon/extra/radeon-profile.png");
    trayIcon = new QSystemTrayIcon(appicon,this);
    trayIcon->show();
    trayIcon->setContextMenu(trayMenu);
    connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #19
0
Buddies::Buddies(QWidget *parent)
    : QMainWindow(parent)
{
	ui.setupUi(this);
	getSysInfo();
	createIconGroupBox();
	createActions();
	createTrayIcon();
	countOnlineUsers();




    QTimer * counter = new QTimer( this );
    connect( counter, SIGNAL(timeout()),
	             this, SLOT(structUser()) );
	counter->start( 3000 );
	qDebug("=> Starting timer 1sec interval...");






	//connect(ui.sendBtn, SIGNAL(clicked()), this, SLOT(showMessage()));
	// connect(ui.showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
    connect(ui.iconComboBox, SIGNAL(currentIndexChanged(int)),this, SLOT(setIcon(int)));
	connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
	connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
	           this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

	ui.iconComboBox->setCurrentIndex(1);

	trayIcon->show();

	setWindowTitle(tr("Buddies"));
	//resize(400, 300);


	ui.listWidget->setIconSize(QSize(40, 40));

	//showMessage();

//-- timer 5 min for online Users Baloon

	QTimer * onlinetimer = new QTimer( this );
		    connect( onlinetimer, SIGNAL(timeout()),
			             this, SLOT(onlineNotify()) );
			onlinetimer->start( 300000 );
			qDebug("=> Starting timer 5min interval...");

//-- Information on Edit Tab

			Information();
//-- Database status
			dbstatus();

}
Beispiel #20
0
//------------------------------------------------------------------------------------------------
//################################################################################################
//------------------------------------------------------------------------------------------------
Window::Window()
{
    errorMessage = new QErrorMessage(this);

    createTabs();

    createActions();
    createTrayIcon();

    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabs);

    QHBoxLayout *bl = new QHBoxLayout;

    quitButton = new QPushButton(QIcon(":/images/door-open-out.png"), tr("Quit"));
    quitButton->setAutoDefault(false);
    quitButton->setFocusPolicy(Qt::NoFocus);
    connect(quitButton, SIGNAL(clicked()), this, SLOT(quitApp()));
    bl->addWidget(quitButton, 0, Qt::AlignLeft);

    aboutButton = new QPushButton(QIcon(":/images/question-balloon.png"), tr("About"));
    aboutButton->setAutoDefault(false);
    aboutButton->setFocusPolicy(Qt::NoFocus);
    connect(aboutButton, SIGNAL(clicked()), this, SLOT(about()));
    bl->addWidget(aboutButton, 0, Qt::AlignCenter);

    closeButton = new QPushButton(QIcon(":/images/tick.png"), tr("Close"));
    closeButton->setAutoDefault(false);
    closeButton->setFocusPolicy(Qt::NoFocus);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeWanted()));
    bl->addWidget(closeButton, 0, Qt::AlignRight);

    mainLayout->addLayout(bl);

    setLayout(mainLayout);

    pingTimer = new QTimer(this);
    connect(pingTimer, SIGNAL(timeout()), this, SLOT(pingProc()));
    switchTimer = new QTimer(this);
    connect(switchTimer, SIGNAL(timeout()), this, SLOT(switchProc()));
    prioTimer = new QTimer(this);
    connect(prioTimer, SIGNAL(timeout()), this, SLOT(prioProc()));

    trayIcon->show();
    setWindowTitle("QGateway");

    readSettings();

    settChanged = false;
    startupChanged = true;
    checkStartup();

    setWindowIcon(QIcon(":/images/computer-network.png"));
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    timer(new QTimer(this))
{
    ui->setupUi(this);

    this->setWindowIcon(QIcon(":/icon.png"));

    Qt::WindowFlags flags = this->windowFlags();

    this->setWindowFlags(flags | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); //
    this->setAttribute(Qt::WA_TranslucentBackground, true);

    timer->setTimerType(Qt::PreciseTimer); // fixes subtitle delay
    connect(timer, SIGNAL(timeout()), this, SLOT(update()));

    connect(ui->backwardButton, SIGNAL(clicked()), this, SLOT(fastBackward()));
    connect(ui->forwardButton, SIGNAL(clicked()), this, SLOT(fastForward()));

    connect(ui->toggleButton, SIGNAL(clicked()), this, SLOT(togglePlay()));
    connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(openFileDialog()));
    connect(ui->prefButton, SIGNAL(clicked()), this, SLOT(openSettingsWindow()));
    connect(ui->quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(sliderMoved(int)));


    if (QSystemTrayIcon::isSystemTrayAvailable()) {
        trayIcon = new QSystemTrayIcon();
        trayIcon->setIcon(QIcon(":/icon.png"));

        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

        menu = new QMenu();

        QAction *settings = new QAction("Preferences", 0);
        connect(settings, SIGNAL(triggered()), this, SLOT(openSettingsWindow()));
        menu->addAction(settings);

        QAction *quit = new QAction("Quit", 0);
        connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
        menu->addAction(quit);

        trayIcon->setContextMenu(menu);

        trayIcon->show();
    }

    this->setAttribute(Qt::WA_Hover, true);

    ui->bottomWidgets->setAttribute(Qt::WA_NoMousePropagation); // fix window disappear problem

    this->loadPref();
    setAcceptDrops(true);
}
Beispiel #22
0
void TrayIcon::setupConnections()
{
  // systray icon clicked
  connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
          this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

  // project list changed
  connect(this, SIGNAL(projectListChanged()),
          this, SLOT(setupMenu()));
}
Beispiel #23
0
window::window(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::window)
{
    ui->setupUi(this);

    friends_table = new table_model(this);

    ui->tableView->setModel(friends_table);
    ui->tableView->verticalHeader()->hide();
    ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);

    connect(ui->add, SIGNAL(clicked()), this, SLOT(add_row()));
    connect(ui->remove, SIGNAL(clicked()), this, SLOT(remove_rows()));
    connect(ui->close, SIGNAL(clicked()), this, SLOT(apply_settings()));

    manager = new QNetworkAccessManager(this);

    connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(readyRead(QNetworkReply*)));

    // define tray icon

    QAction * quit_action = new QAction(tr("&Quit"), this);
    connect(quit_action, SIGNAL(triggered()), qApp, SLOT(quit()));
    QAction * settings_action = new QAction(tr("&Settings"), this);
    connect(settings_action, SIGNAL(triggered()), this, SLOT(show()));

    QMenu * tray_menu = new QMenu(this);
    tray_menu->addAction(settings_action);
    tray_menu->addSeparator();
    tray_menu->addAction(quit_action);

    tray_icon = new QSystemTrayIcon(this);
    tray_icon->setContextMenu(tray_menu);

    connect(tray_icon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));


    QIcon icon(":/images/teeworlds_1.png");
    tray_icon->setIcon(icon);
    setWindowIcon(icon);

    tray_icon->setToolTip("Teeworlds Notifier");

    tray_icon->show();

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(mainloop()));
    //timer->start(update_interval * 1000);

    need_correction = 2;
    mainloop();
}
Beispiel #24
0
SystemTray::SystemTray(QObject *parent)
  : QObject(parent)
{
  trayIcon = new QSystemTrayIcon();
  trayIcon->setIcon(QIcon(":/icon.ico"));
  trayIcon->show();
  trayIcon->setToolTip("SMSClient");

  connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
          this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #25
0
void MainWindow::createTrayIcon() {
    QMenu *trayIconMenu = new QMenu(this);
    trayIconMenu->addAction(closeAction);

    trayIcon = new QSystemTrayIcon(this);
    trayIcon->setContextMenu(trayIconMenu);
    trayIcon->setIcon(QIcon(":/resources/appicon.svg"));
    trayIcon->show();

    connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,
        SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #26
0
MainWindow::MainWindow(QWidget * parent):
QMainWindow(parent), ui(new Ui::MainWindow)
{
    const char *version = openconnect_get_version();
    QString txt;

    ui->setupUi(this);
    this->setWindowTitle(QLatin1String("openconnect " VERSION));

    txt = QLatin1String("Based on libopenconnect ") + QLatin1String(version);
    txt +=
        QLatin1String("\nGnuTLS: ") + QLatin1String(gnutls_check_version(NULL));
    ui->versionLabel->setText(txt);

    timer = new QTimer(this);
    blink_timer = new QTimer(this);
    this->cmd_fd = INVALID_SOCKET;

    connect(ui->actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));

    connect(blink_timer, SIGNAL(timeout(void)), this, SLOT(blink_ui(void)),
            Qt::QueuedConnection);
    connect(timer, SIGNAL(timeout()), this, SLOT(request_update_stats()),
            Qt::QueuedConnection);
    connect(ui->comboBox->lineEdit(), SIGNAL(returnPressed()), this,
            SLOT(on_connectBtn_clicked()), Qt::QueuedConnection);
    connect(this, SIGNAL(vpn_status_changed_sig(int)), this,
            SLOT(changeStatus(int)), Qt::QueuedConnection);
    QObject::connect(this, SIGNAL(log_changed(QString)), this,
                     SLOT(writeProgressBar(QString)), Qt::QueuedConnection);
    QObject::connect(this, SIGNAL(stats_changed_sig(QString, QString, QString)),
                     this, SLOT(statsChanged(QString, QString, QString)),
                     Qt::QueuedConnection);
    ui->iconLabel->setPixmap(OFF_ICON);
    QNetworkProxyFactory::setUseSystemConfiguration(true);

    if (QSystemTrayIcon::isSystemTrayAvailable()) {
        QIcon icon;
        createActions();
        createTrayIcon();

        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

        icon.addPixmap(TRAY_OFF_ICON, QIcon::Normal, QIcon::Off);
        trayIcon->setIcon(icon);
        trayIcon->show();
    } else {
        updateProgressBar(QLatin1String("System doesn't support tray icon"),
                          false);
        trayIcon = NULL;
    }
}
void MainWindow::createTrayMenu()
{
    trayMenu = new QMenu(this);
    trayMenu->addAction(shw);
    trayMenu->addAction(log_in);
    trayMenu->addAction(log_out);
    trayMenu->addSeparator();
    trayMenu->addAction(about);
    trayMenu->addAction(quit);
    tray->setContextMenu(trayMenu);
    connect(tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #28
0
void Window::configureTrayIcon(){
    configureTrayIconMenu();
    trayIcon = new QSystemTrayIcon(this);
    trayIcon->setContextMenu(trayIconMenu);

    QIcon icon(":/images/Tracker.png");
    trayIcon->setIcon(icon);
    setWindowIcon(icon);
    trayIcon->setToolTip("Press to start tracking");
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
    trayIcon->setVisible(true);
}
Beispiel #29
0
TrayIcon::TrayIcon(QMainWindow *parent) {
  parentwin = parent;

  createActions();
  createTrayIcon();

  sysTrayIcon->setIcon(QIcon(":/artwork/icon.png"));

  sysTrayIcon->show();

  QObject::connect(sysTrayIcon,
                   SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
                   SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
Beispiel #30
0
Tray::Tray(QObject *parent) : QObject(parent) {
    mainWindow = (MainWindow*)parent;

    settings = ClientSettings::Instance();
    conversations = settings->getParameter("Tray/conversations", true).toBool();

    createTrayIcon();

    connect(trayIcon, SIGNAL(messageClicked()), mainWindow, SLOT(showMaximized()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    trayIcon->show();
}