ViewerDialog::ViewerDialog(QWidget* parent, GalleryListModel& model, int row): QDialog(parent), ui(new Ui::ViewerDialog) { isSlide = false; setWindowFlags(Qt::FramelessWindowHint); ui->setupUi(this); title = new TitleControl(this); ui->lLayout->addWidget(title); viewer = new ViewerControl(this, model, row); viewer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); ui->lLayout->addWidget(viewer); createMenuAndActions(); updateButtons(); //QTimer::singleShot(10, this, SLOT(currentEvent())); currentEvent(); }
qvortaro::qvortaro(QWidget *parent) : QMainWindow(parent) { Config::instance()->read(); ui.setupUi(this); statusBar()->hide(); createMenuAndActions(); QObject::connect(m_aBeenden, SIGNAL(triggered()), this, SLOT(slot_quit())); QObject::connect(m_agAnordnungLexika, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeAnordnungLexika(QAction*))); QObject::connect(m_agGestaltungLexikaAnordnung, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeGestaltungLexika(QAction*))); QObject::connect(m_agGestaltungLexikaGestaltung, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeGestaltungLexika(QAction*))); QObject::connect(m_agLexika1, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeLexika1(QAction*))); QObject::connect(m_agLexika2, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeLexika2(QAction*))); QObject::connect(m_agCaption, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeCaption(QAction*))); QObject::connect(m_aProgrammEinrichten, SIGNAL(triggered()), this, SLOT(slot_configDgl())); QObject::connect(m_aAnsichtSpeichern, SIGNAL(triggered()), this, SLOT(slot_ansichtSpeichern())); QObject::connect(m_aAnsichtZeigeLanguage2, SIGNAL(triggered(bool)), this, SLOT(slot_zeigeLanguage2())); QObject::connect(m_aAnsichtZeigeLanguage2, SIGNAL(toggled(bool)), this, SLOT(slot_zeigeLanguage2())); QObject::connect(m_agAnsichtLaden, SIGNAL(triggered(QAction*)), this, SLOT(slot_ansichtLaden(QAction*))); QObject::connect(m_aUeber, SIGNAL(triggered()), this, SLOT(slot_showUeber())); QObject::connect(m_aStayOnTop, SIGNAL(triggered(bool)), this, SLOT(slot_stayOnTop())); mySearchLayout1 = new SearchLayout1(); ui.sw->insertWidget(0, mySearchLayout1); ui.sw->setCurrentIndex(0); // Zwischenablage m_cb = QApplication::clipboard(); m_cbStringLast = getCbString(); m_cbTimer = new QTimer(this); m_cbTimer->setSingleShot(true); QObject::connect(m_cbTimer, SIGNAL(timeout()), this, SLOT(slot_checkCb())); slot_checkCb(); // Keine Wörterbücher gefunden if (Config::instance()->languages().isEmpty()) { if (!Config::instance()->containsPathLexika(QApplication::applicationDirPath()+QDir::separator()+"dict") && !Config::instance()->containsPathLexika(QApplication::applicationDirPath())) QMessageBox::warning( this, "qVortaro - "+trUtf8("Keine Wörterbücher gefunden"), trUtf8("Es konnten keine Wörterbucher gefunden werden!\n\n" "Bitte überprüfen Sie unter »Einstellungen->aVortaro einrichten«,\n" "ob der richtige Pfad zum Ordner mit den Wörterbüchern\n" "angegeben wurde."), QMessageBox::Ok); } if (Config::instance()->restoreOnStartup() && !Config::instance()->currentView().isEmpty() && Config::instance()->currentView().contains("zeigeLanguage2")) { restoreView(Config::instance()->currentView()); m_aStayOnTop->setChecked(Config::instance()->stayOnTop()); slot_stayOnTop(); } else { m_aStayOnTop->setChecked(false); slot_stayOnTop(); Config::instance()->setCurrentView(getDefaultView()); restoreView(getDefaultView()); adjustSize(); } }