abstractfactory/pyblish — pull request #72 by madoodia (2014-09-07 09:56:00+00:00)
Title: GUI - First Step Of GUI - "just a Pyblish button"

Hey guys.
Sorry for delay in pushing this old work, but this is first step, and starting point of our works on GUI of Pyblish.
This is related to [GUI issue]( #41 ), and i try to start title of GUI related issues with "GUI".
As you know we want to create Pyblish GUI with QML technology of QT framework, so for running this GUIs you need to these prerequistics :
- [Python 2.7](https://www.python.org/download/releases/2.7)
- [Qt 5.2 or later](http://qt-project.org/downloads)
- [PyQt 5.2 or later](http://www.riverbankcomputing.co.uk/software/pyqt/download5)

----

### First GUI
This is a really simple QML gui that i created for test.

![first_gui](https://cloud.githubusercontent.com/assets/3639157/4177978/f5bd1d0c-366b-11e4-8573-efbc1c578ee5.jpg)

----

#### Workflow
Instead of clicking on a **publish** menu from **maya File menu** we should have a window that work for us.
Now in the First Step of work we just have a window with a simple button in it, that work for us like publish button inside maya,
I should say that this button does not work in maya yet. but when we hit the button it print a message for us, "**Your instances is published**".
Now we just should work with fake data, and in next steps we have more word to tell.

----

### Frontend folders
In frontend folder we have folders thatcontain all stuffs we need .

![folders_01](https://cloud.githubusercontent.com/assets/3639157/4177999/8cc88a18-366e-11e4-989f-de8687e7dc5a.jpg)

- **content**: images we need for using in gui as icons
- **gui**: main code of our gui is in this folder such as main.py, pyblish.qml
- **utils**: all components (Types or Classes) that we create for reusing in our gui

----

### How work
when you install all needed frameworks you can test you qml running with this steps:
1. create a test.qml file contain:

```
import QtQuick 2.0
Rectangle {
id: window
width: 320
height: 480
color: "#00aa00"
}
```
2. in command prompt run:

`qmlscene.exe test.qml`
it works if you add `C:\Qt\Qt5.2.1\5.2.1\msvc2012_64\bin` to `PYTHONPATH`
and if works you can see a little green window.

3. now you can run :
`python main.py` from `pyblish/frontend/gui`

----

## Relationship between Python - PyQt - QML

There is a nice relationship between this three brothers to create a Strong GUI,

```

_________________________ _____________________
| | | |
| Python <----------| Pyblish |
|_________________________| |_____________________|
| ^
____________v____________ __________|__________
| | | |
| PyQt | | Maya |
|_________________________| |_____________________|
| ^
_______v__________|______
| |
| QML |
|_________________________|
```

Now we don't have pyblish and maya connection in this version of GUI. and the role of pyblish is played with **Pyblish class** in **main.py** and the role of maya is played with **Host class**, that these two class create fake data for us now.

And Controller Class indeed is a new type that we should create for connecting to QML from PyQt.

Many things will be changed, but now this is start point of our work for GUI of Pyblish.

----

## How to get your pull request up and running?
I work in windows and so far i used cmd for working with github (but now i want to switch to sourceTree)

**cmd**:

1. create your fork from `https://github.com/abstractfactory/pyblish` here i have `madoodia`
2. git clone https://github.com/`madoodia`/pyblish
3. cd pyblish
4. git remote add abstractfactory https://github.com/abstractfactory/pyblish.git
5. git pull abstractfactory master
6. after you create your own changes: `git push origin master`
7. ![screenshot 194](https://cloud.githubusercontent.com/assets/3639157/4178067/176d8fdc-3675-11e4-986a-ed5dc0bf1211.png)

8. create new issue

thanks.
and i wait for your comments.
good luck.