Skip to content

Commit

Permalink
Added about page
Browse files Browse the repository at this point in the history
  • Loading branch information
sczhengyabin committed Dec 1, 2016
1 parent 02b43dd commit da21dc5
Show file tree
Hide file tree
Showing 7 changed files with 411 additions and 35 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ Using python3 and PyQt4
## 2. Solve dependencies

2.1 Copy phantomjs executable in ./bin to /usr/bin/, or just add it to PATH.
This is the Linux 64 version, download the corresponding version of phantomjs
from official website if you'd like run it on other platform.)
phantomjs executable can be downloaded from [here](https://bitbucket.org/ariya/phantomjs/downloads)

2.2 Install depend packages through python pip

depend packages: selenium futures requests

## 3. Usage

Change keywords and options in main.py, then run it !
2.2 solve requirements.txt
pip install -r requirements.txt

## 3. Windows bundled executable binary.
Download prebuilt windows binary from [here](https://github.com/sczhengyabin/Google-Image-Downloader/releases)
205 changes: 205 additions & 0 deletions about.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog_about</class>
<widget class="QDialog" name="Dialog_about">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>200</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,2,11,1">
<item row="0" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>43</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Author:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Yabin Zheng</string>
</property>
<property name="cursorPosition">
<number>0</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>34</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Email:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEdit_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>[email protected]</string>
</property>
<property name="cursorPosition">
<number>0</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>34</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Project Home:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lineEdit_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>https://github.com/sczhengyabin/Google-Image-Downloader</string>
</property>
<property name="cursorPosition">
<number>0</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>42</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
14 changes: 11 additions & 3 deletions mainwindow.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# -*- coding: utf-8 -*-

from ui_mainwindow import Ui_MainWindow

from ui_about import Ui_Dialog_about
import utils

from PyQt4.Qt import *
from PyQt4.QtTest import QTest
from multiprocessing import Process
from threading import Thread
import shlex
import os
import sys

import image_downloader
from logger import logger


class DialogAbout(QDialog, Ui_Dialog_about):
def __init__(self):
QDialog.__init__(self)
self.setupUi(self)


class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
logger.log_hooks.append(self.log)
Expand All @@ -25,6 +29,8 @@ def __init__(self):

self.setupUi(self)

self.dialog_about = DialogAbout()

self.state = "stop"

self.elapsed_timer = QElapsedTimer()
Expand All @@ -38,6 +44,8 @@ def __init__(self):
self.process_log_timer.timeout.connect(self.progress_log)
self.process_log_timer.start()

self.actionAbout.triggered.connect(self.dialog_about.show)

self.pushButton_load_file.clicked.connect(
lambda: self.lineEdit_path2file.setText(QFileDialog.getOpenFileName(
self, "Load keywords from file", "./", "Text files (*.txt)")))
Expand Down
Loading

0 comments on commit da21dc5

Please sign in to comment.