BrowsingLibrary::BrowsingLibrary(QupZilla* mainClass, QWidget* parent) : QWidget(parent) , ui(new Ui::BrowsingLibrary) , m_historyManager(new HistoryManager(mainClass)) , m_bookmarksManager(new BookmarksManager(mainClass)) , m_rssManager(mApp->rssManager()) , m_historyLoaded(false) , m_bookmarksLoaded(false) , m_rssLoaded(false) { ui->setupUi(this); QSettings settings(mApp->getActiveProfilPath() + "settings.ini", QSettings::IniFormat); settings.beginGroup("BrowsingLibrary"); resize(settings.value("size", QSize(760, 470)).toSize()); settings.endGroup(); qz_centerWidgetOnScreen(this); ui->tabs->AddTab(m_historyManager, QIcon(":/icons/other/bighistory.png"), tr("History")); ui->tabs->AddTab(m_bookmarksManager, QIcon(":/icons/other/bigstar.png"), tr("Bookmarks")); ui->tabs->AddTab(m_rssManager, QIcon(":/icons/other/bigrss.png"), tr("RSS")); ui->tabs->SetMode(FancyTabWidget::Mode_LargeSidebar); ui->tabs->setFocus(); connect(ui->tabs, SIGNAL(CurrentChanged(int)), this, SLOT(currentIndexChanged(int))); connect(ui->searchLine, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(search())); }
DownloadManager::DownloadManager(QWidget* parent) : QWidget(parent) , ui(new Ui::DownloadManager) , m_isClosing(false) { setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint); ui->setupUi(this); #ifdef Q_WS_WIN if (QtWin::isCompositionEnabled()) { QtWin::extendFrameIntoClientArea(this); } #endif ui->clearButton->setIcon(QIcon::fromTheme("edit-clear")); qz_centerWidgetOnScreen(this); m_networkManager = mApp->networkManager(); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearList())); loadSettings(); #ifdef W7TASKBAR if (QtWin::isRunningWindows7()) { win7.init(this->winId()); } #endif }
CookieManager::CookieManager(QWidget* parent) : QWidget(parent) , ui(new Ui::CookieManager) , m_refreshCookieJar(true) { ui->setupUi(this); qz_centerWidgetOnScreen(this); // Stored Cookies connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->search, SIGNAL(textChanged(QString)), ui->cookieTree, SLOT(filterString(QString))); // Cookie Filtering connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); ui->search->setPlaceholderText(tr("Search")); ui->cookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->cookieTree->sortItems(0, Qt::AscendingOrder); ui->cookieTree->header()->setDefaultSectionSize(220); ui->cookieTree->setFocus(); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); }
void PopupWindow::setWindowGeometry(const QRect &newRect) { if (newRect.isValid()) { QRect oldRect = rect(); setGeometry(newRect); if (newRect.topLeft() == QPoint(0, 0) && oldRect.topLeft() == QPoint(0, 0)) { qz_centerWidgetOnScreen(this); } } }
void PopupWindow::setWindowGeometry(const QRect &newRect) { if (newRect.isValid()) { QRect oldRect = rect(); move(newRect.topLeft()); QSize newSize = newRect.size(); int additionalHeight = height() - m_view->height(); newSize.setHeight(newSize.height() + additionalHeight); resize(newSize); if (newRect.topLeft() == QPoint(0, 0) && oldRect.topLeft() == QPoint(0, 0)) { qz_centerWidgetOnScreen(this); } } }