/** La construction consiste juste à mettre en place les connexions qvb */ RzxNotifier::RzxNotifier() :RzxModule(RZX_MODULE_NAME, QT_TRANSLATE_NOOP("RzxBaseModule", "Notify that a favorite state has changed"), RZX_MODULE_VERSION) { beginLoading(); favoriteWarn = false; ui = NULL; propWidget = NULL; setType(MOD_GUI); setIcon(RZX_MODULE_ICON); new RzxNotifierConfig(this); connect(RzxConnectionLister::global(), SIGNAL(login(RzxComputer* )), this, SLOT(login(RzxComputer* ))); connect(RzxConnectionLister::global(), SIGNAL(initialLoging(bool)), this, SLOT(ignoreLoging(bool))); RzxTranslator::connect(this, SLOT(translate())); RzxIconCollection::connect(this, SLOT(changeTheme())); if(RzxConnectionLister::global()->computerNumber()) ignoreLoging(false); #ifdef Q_OS_MAC installGrowlSupport(); #endif endLoading(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //objet pour la gestion des réglages settingsTable = new QSettings("outadoc", "FreeStance"); options = new Options(this); about = new About(this); help = new Help(this); settings = new AppSettings; //on vérifie les mises à jour checkForUpdates(); bool hasBeenSet = settingsTable->value("hasBeenSet", false).toBool(); //si le programme n'a jamais été utilisé... if(hasBeenSet != true) { settingsTable->setValue("hasBeenSet", false); options->show(); } //on centre la fenêtre QDesktopWidget *widget = QApplication::desktop(); int desktop_width = widget->width(); int desktop_height = widget->height(); int x = desktop_width / 2 - width() / 2; int y = desktop_height / 2 - height() / 2 - 25; move(QPoint(x, y)); //on récupère le dernier profil utilisé pour l'utiliser par défaut dans le programme if(settings->getProfileToUse() == 1) { ui->actionProfil_1->setChecked(true); ui->actionProfil_2->setChecked(false); ui->actionProfil_3->setChecked(false); } else if (settings->getProfileToUse() == 2) { ui->actionProfil_1->setChecked(false); ui->actionProfil_2->setChecked(true); ui->actionProfil_3->setChecked(false); } else if(settings->getProfileToUse() == 3) { ui->actionProfil_1->setChecked(false); ui->actionProfil_2->setChecked(false); ui->actionProfil_3->setChecked(true); } //url pour les programmes tv setProgrammetvNetUrl(QUrl(tr("http://www.programme-tv.net/programme/free-13/"))); setProgrammeTvUrl(QUrl(tr("http://dev.outadoc.fr/freestance/tvprog.html"))); setCesoirtvComUrl(QUrl(tr("http://cesoirtv.com/"))); setTvmagComUrl(QUrl(tr("http://www.tvmag.com/programme-tv/guide-tele.html?boId=2"))); setTvexpressComUrl(QUrl(tr("http://tv-express.com/"))); setHomepage(getTvexpressComUrl()); //chargement du guide epg webbrowser = new QWebView; vbox = new QVBoxLayout; vbox->addWidget(webbrowser); ui->web_frame->setLayout(vbox); ui->prgrbar_browser->setVisible(false); webbrowser->load(getHomepage()); //connections pour l'epg connect(ui->b_refresh, SIGNAL(clicked()), webbrowser, SLOT(reload())); connect(ui->b_prev, SIGNAL(clicked()), webbrowser, SLOT(back())); connect(ui->b_fw, SIGNAL(clicked()), webbrowser, SLOT(forward())); connect(ui->cbox_site, SIGNAL(currentIndexChanged(int)), this, SLOT(changeWebsite(int))); connect(webbrowser, SIGNAL(loadStarted()), this, SLOT(beginLoading())); connect(webbrowser, SIGNAL(loadProgress(int)), this, SLOT(loading(int))); connect(webbrowser, SIGNAL(loadFinished(bool)), this, SLOT(stopLoading(bool))); connect(ui->actionPr_f_rences, SIGNAL(triggered()), options, SLOT(show())); connect(ui->actionV_rifier_les_mises_jour, SIGNAL(triggered()), SLOT(checkForUpdates())); //on affiche la version dans le bas ui->lbl_actual_version->setText(VERSION); //le stay on top ne marche pas pour le moment, donc ui->actionToujours_au_dessus->setVisible(false); }