Ejemplo n.º 1
0
    def do_activate(self):

        self.win = wn.Window()

        self.wine = w.Wine(self.win)
        self.wine.check_work_dir()

        self.win.set_default_size(550, 600)
        self.win.set_resizable(False)
        self.win.connect("delete-event", Gtk.main_quit)

        parser = argparse.ArgumentParser(
            description=cn.App.application_description)
        parser.add_argument('--about',
                            action='store_true',
                            help='About ' + cn.App.application_name)
        args = parser.parse_args()
        if args.about == True:
            self.show_about(self.win)
        else:
            self.win.show_all()
            self.win.hbar.back.hide()
            self.win.hbar.save.hide()
            self.win.hbar.trash.hide()
            self.win.hbar.properties.hide()

        Gtk.main()
Ejemplo n.º 2
0
    def __init__(self, parent):
        Gtk.HeaderBar.__init__(self)
        self.parent = parent
        self.wine = w.Wine(self)
        self.HGtk = hl.HGtk()

        locale_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')

        try:
            current_locale, encoding = locale.getdefaultlocale()
            translate = gettext.translation ('bottles', locale_path, [current_locale] )
            _ = translate.gettext
        except FileNotFoundError:
            _ = str

        self.set_show_close_button(True)
        self.props.title = cn.App.application_name

        # help button
        # self.help = Gtk.Button.new_from_icon_name("help-contents", Gtk.IconSize.LARGE_TOOLBAR)
        # self.help.connect("clicked", self.on_help_clicked)
        # self.pack_end(self.help)

        # trash button
        self.trash = Gtk.Button()
        self.trash = Gtk.Button.new_from_icon_name("edit-delete", Gtk.IconSize.LARGE_TOOLBAR)
        self.trash.connect("clicked", self.on_trash_clicked)
        self.pack_end(self.trash)

        # properties button
        self.properties = Gtk.Button()
        self.properties = Gtk.Button.new_from_icon_name("document-properties", Gtk.IconSize.LARGE_TOOLBAR)
        self.properties.connect("clicked", self.on_properties_clicked)
        self.pack_end(self.properties)

        # save button
        self.save = Gtk.Button(_('Save'))
        self.save.connect("clicked", self.on_save_clicked)
        self.HGtk.add_class(self.save, "suggested-action")
        self.pack_end(self.save)

        # spinner button
        self.spinner = Gtk.Spinner()
        self.pack_end(self.spinner)

        # back button
        self.back = Gtk.Button(_('Return'))
        self.back.connect("clicked", self.on_back_clicked)
        Gtk.StyleContext.add_class(self.back.get_style_context(), "back-button")
        self.pack_start(self.back)
Ejemplo n.º 3
0
    def __init__(self, parent):
        Gtk.Box.__init__(self, False, 0)
        self.wine = w.Wine(self)
        self.parent = parent
        self.set_name("WineImporter")

        self.set_orientation(Gtk.Orientation.VERTICAL)

        self.num = 0
        self.description = Gtk.Label()
        self.description.set_name('WineDescription')
        self.description.set_justify(Gtk.Justification.CENTER)
        self.add(self.description)
        self.generate_entries()
Ejemplo n.º 4
0
 def __init__(self, parent):
     Gtk.ScrolledWindow.__init__(self)
     self.parent = parent
     self.wine = w.Wine(self)
     self.generate_entries()
Ejemplo n.º 5
0
    def __init__(self, parent):
        Gtk.Box.__init__(self, False, 0)
        self.wine = w.Wine(self)
        self.parent = parent
        HGtk = hl.HGtk

        try:
            current_locale, encoding = locale.getdefaultlocale()
            locale_path = os.path.join(
                os.path.abspath(os.path.dirname(__file__)), 'locale')
            translate = gettext.translation(cn.App.application_shortname,
                                            locale_path, [current_locale])
            _ = translate.gettext
        except FileNotFoundError:
            _ = str

        self._ = _

        self.set_border_width(20)
        self.set_orientation(Gtk.Orientation.VERTICAL)
        self.set_name("WineDetail")

        self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.add(self.vbox)

        self.grid_1 = Gtk.Grid()
        self.grid_1.set_column_homogeneous(True)
        self.grid_1.set_column_spacing(20)
        self.vbox.add(self.grid_1)

        # Drive C
        self.button_drive_c = Gtk.Button.new_from_icon_name(
            "folder", Gtk.IconSize.DIALOG)
        self.button_drive_c.connect("clicked", self.on_button_drive_c_clicked)
        self.grid_1.add(self.button_drive_c)

        # Winecfg
        self.button_wine_cfg = Gtk.Button.new_from_icon_name(
            "wine-winecfg", Gtk.IconSize.DIALOG)
        self.button_wine_cfg.connect("clicked",
                                     self.on_button_wine_cfg_clicked)
        self.grid_1.add(self.button_wine_cfg)

        # Winetricks
        self.button_winetricks = Gtk.Button.new_from_icon_name(
            "winetricks", Gtk.IconSize.DIALOG)
        self.button_winetricks.connect("clicked",
                                       self.on_button_winetricks_clicked)
        self.grid_1.add(self.button_winetricks)

        grid_2 = Gtk.Grid()
        grid_2.set_column_spacing(20)
        grid_2.set_column_homogeneous(True)
        self.vbox.add(grid_2)

        label_drive_c = Gtk.Label(_('Browse C:'))
        HGtk.add_class(self, label_drive_c, "label_cell")
        grid_2.add(label_drive_c)

        label_wine_cfg = Gtk.Label(_('Configure'))
        HGtk.add_class(self, label_wine_cfg, "label_cell")
        grid_2.add(label_wine_cfg)

        label_winetricks = Gtk.Label(_('Winetricks'))
        HGtk.add_class(self, label_winetricks, "label_cell")
        grid_2.add(label_winetricks)

        self.grid_3 = Gtk.Grid()
        self.grid_3.set_column_spacing(20)
        self.grid_3.set_column_homogeneous(True)
        self.vbox.add(self.grid_3)

        # Terminal
        self.button_terminal = Gtk.Button.new_from_icon_name(
            "utilities-terminal", Gtk.IconSize.DIALOG)
        self.button_terminal.connect("clicked",
                                     self.on_button_terminal_clicked)
        self.grid_3.add(self.button_terminal)

        # Monitor
        self.button_monitor = Gtk.Button.new_from_icon_name(
            "utilities-system-monitor", Gtk.IconSize.DIALOG)
        self.button_monitor.connect("clicked", self.on_button_monitor_clicked)
        self.grid_3.add(self.button_monitor)

        # Settings
        self.button_settings = Gtk.Button.new_from_icon_name(
            "preferences-desktop", Gtk.IconSize.DIALOG)
        self.button_settings.connect("clicked",
                                     self.on_button_settings_clicked)
        self.grid_3.add(self.button_settings)

        grid_4 = Gtk.Grid()
        grid_4.set_column_spacing(20)
        grid_4.set_column_homogeneous(True)
        self.vbox.add(grid_4)

        label_terminal = Gtk.Label(_('Terminal'))
        HGtk.add_class(self, label_terminal, "label_cell")
        grid_4.add(label_terminal)

        label_monitor = Gtk.Label(_('Task manager'))
        HGtk.add_class(self, label_monitor, "label_cell")
        grid_4.add(label_monitor)

        label_settings = Gtk.Label(_('Control panel'))
        HGtk.add_class(self, label_settings, "label_cell")
        grid_4.add(label_settings)

        self.grid_5 = Gtk.Grid()
        self.grid_5.set_column_spacing(20)
        self.grid_5.set_column_homogeneous(True)
        self.vbox.add(self.grid_5)

        # Regedit
        self.button_regedit = Gtk.Button.new_from_icon_name(
            "dialog-password", Gtk.IconSize.DIALOG)
        self.button_regedit.connect("clicked", self.on_button_regedit_clicked)
        self.grid_5.add(self.button_regedit)

        # Uninstaller
        self.button_uninstaller = Gtk.Button.new_from_icon_name(
            "wine-uninstaller", Gtk.IconSize.DIALOG)
        self.button_uninstaller.connect("clicked",
                                        self.on_button_uninstaller_clicked)
        self.grid_5.add(self.button_uninstaller)

        # Reboot
        self.button_reboot = Gtk.Button.new_from_icon_name(
            "system-reboot", Gtk.IconSize.DIALOG)
        self.button_reboot.connect("clicked", self.on_button_reboot_clicked)
        self.grid_5.add(self.button_reboot)

        grid_6 = Gtk.Grid()
        grid_6.set_column_spacing(20)
        grid_6.set_column_homogeneous(True)
        self.vbox.add(grid_6)

        label_regedit = Gtk.Label(_('Regedit'))
        HGtk.add_class(self, label_regedit, "label_cell")
        grid_6.add(label_regedit)

        label_uninstaller = Gtk.Label(_('Uninstaller'))
        HGtk.add_class(self, label_uninstaller, "label_cell")
        grid_6.add(label_uninstaller)

        label_reboot = Gtk.Label(_('Reboot'))
        HGtk.add_class(self, label_reboot, "label_cell")
        grid_6.add(label_reboot)

        self.grid_7 = Gtk.Grid()
        self.grid_7.set_column_spacing(20)
        self.grid_7.set_column_homogeneous(True)
        self.vbox.add(self.grid_7)

        # Clone
        self.button_clone = Gtk.Button.new_from_icon_name(
            "edit-copy", Gtk.IconSize.DIALOG)
        self.button_clone.connect("clicked", self.on_button_clone_clicked)
        self.grid_7.add(self.button_clone)

        # Run
        self.button_run = Gtk.Button.new_from_icon_name(
            "application-x-msi", Gtk.IconSize.DIALOG)
        self.button_run.connect("clicked", self.on_button_run_clicked)
        self.grid_7.add(self.button_run)

        # Debug
        self.button_debug = Gtk.Button.new_from_icon_name(
            "system-run", Gtk.IconSize.DIALOG)
        self.button_debug.connect("clicked", self.on_button_debug_clicked)
        self.grid_7.add(self.button_debug)

        grid_8 = Gtk.Grid()
        grid_8.set_column_spacing(20)
        grid_8.set_column_homogeneous(True)
        self.vbox.add(grid_8)

        label_clone = Gtk.Label(_('Clone'))
        HGtk.add_class(self, label_clone, "label_cell")
        grid_8.add(label_clone)

        label_run = Gtk.Label(_('Run .exe here'))
        HGtk.add_class(self, label_run, "label_cell")
        grid_8.add(label_run)

        label_debug = Gtk.Label(_('Debug'))
        HGtk.add_class(self, label_debug, "label_cell")
        grid_8.add(label_debug)

        self.grid_9 = Gtk.Grid()
        self.grid_9.set_column_spacing(20)
        self.grid_9.set_column_homogeneous(True)
        self.vbox.add(self.grid_9)

        # Bug
        self.button_bug = Gtk.Button.new_from_icon_name(
            "bug", Gtk.IconSize.DIALOG)
        self.button_bug.connect("clicked", self.on_button_bug_clicked)
        self.grid_9.add(self.button_bug)

        # Forums
        self.button_forums = Gtk.Button.new_from_icon_name(
            "internet-chat", Gtk.IconSize.DIALOG)
        self.button_forums.connect("clicked", self.on_button_forums_clicked)
        self.grid_9.add(self.button_forums)

        # AppDB
        self.button_appdb = Gtk.Button.new_from_icon_name(
            "office-database", Gtk.IconSize.DIALOG)
        self.button_appdb.connect("clicked", self.on_button_appdb_clicked)
        self.grid_9.add(self.button_appdb)

        grid_10 = Gtk.Grid()
        grid_10.set_column_spacing(20)
        grid_10.set_column_homogeneous(True)
        self.vbox.add(grid_10)

        label_bug = Gtk.Label(_('Report bug'))
        HGtk.add_class(self, label_bug, "label_cell")
        grid_10.add(label_bug)

        label_forums = Gtk.Label(_('Forums'))
        HGtk.add_class(self, label_forums, "label_cell")
        grid_10.add(label_forums)

        label_appdb = Gtk.Label(_('Wine Database'))
        HGtk.add_class(self, label_appdb, "label_cell")
        grid_10.add(label_appdb)
Ejemplo n.º 6
0
    def __init__(self, parent):
        Gtk.HeaderBar.__init__(self)
        self.parent = parent
        self.wine = w.Wine(self)
        self.HGtk = hl.HGtk()
        self.set_name("WineHeaderbar")

        locale_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')

        try:
            current_locale, encoding = locale.getdefaultlocale()
            translate = gettext.translation (cn.App.application_shortname, locale_path, [current_locale] )
            _ = translate.gettext
        except FileNotFoundError:
            _ = str

        self.set_show_close_button(True)
        self.props.title = cn.App.application_name

        # help button
        # self.help = Gtk.Button.new_from_icon_name("help-contents", Gtk.IconSize.LARGE_TOOLBAR)
        # self.help.connect("clicked", self.on_help_clicked)
        # self.pack_end(self.help)

        # trash button
        self.trash = Gtk.Button()
        self.trash = Gtk.Button.new_from_icon_name("user-trash-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.trash.connect("clicked", self.on_trash_clicked)
        self.pack_end(self.trash)

        # properties button
        self.properties = Gtk.Button()
        self.properties = Gtk.Button.new_from_icon_name("document-properties-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.properties.connect("clicked", self.on_properties_clicked)
        self.pack_end(self.properties)

        # save button
        self.save = Gtk.Button(_('Save'))
        self.save.connect("clicked", self.on_save_clicked)
        self.HGtk.add_class(self.save, "suggested-action")
        self.pack_end(self.save)

        # start button
        # [INFO] This button shows the applications installed in the selected bottle
        # self.start = Gtk.Button()
        # self.start = Gtk.Button.new_from_icon_name("applications-other", Gtk.IconSize.LARGE_TOOLBAR)
        # self.start.connect("clicked", self.on_start_clicked)
        # self.pack_end(self.start)

        # convert button
        self.convert = Gtk.Button()
        self.convert = Gtk.Button.new_from_icon_name("rotate-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.convert.connect("clicked", self.on_convert_clicked)
        self.pack_end(self.convert)

        # refresh button
        self.refresh = Gtk.Button()
        self.refresh = Gtk.Button.new_from_icon_name("view-refresh-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.refresh.connect("clicked", self.on_refresh_clicked)
        self.pack_end(self.refresh)

        # spinner button
        self.spinner = Gtk.Spinner()
        self.pack_end(self.spinner)

        # back button
        self.back = Gtk.Button.new_from_icon_name("go-previous-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.back.connect("clicked", self.on_back_clicked)
        Gtk.StyleContext.add_class(self.back.get_style_context(), "back-button")
        self.pack_start(self.back)
Ejemplo n.º 7
0
from board import A1
import wine
import neopixel
import time

pixel_pin = A1
num_pixels = 64
rows = 8
cols = 8

wine = wine.Wine()

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, auto_write=False)


def convert_to_num(row, col):
    if row % 2 == 0:
        return (row * 8) + col
    else:
        return ((row + 1) * 8) - (col + 1)


while True:
    frame = wine.calc_next_frame()
    for x in range(0, rows):
        for y in range(0, cols):
            pixels[convert_to_num(y, x)] = wine.frame[x][y]
    pixels.show()
    time.sleep(1)
Ejemplo n.º 8
0
    def __init__(self, parent):
        Gtk.Box.__init__(self, False, 0)
        self.wine = w.Wine(self)
        self.parent = parent

        try:
            current_locale, encoding = locale.getdefaultlocale()
            locale_path = os.path.join(
                os.path.abspath(os.path.dirname(__file__)), 'locale')
            translate = gettext.translation(cn.App.application_shortname,
                                            locale_path, [current_locale])
            _ = translate.gettext
        except FileNotFoundError:
            _ = str

        self.set_border_width(80)
        #win.resize(800,400)
        self.set_orientation(Gtk.Orientation.VERTICAL)

        title = Gtk.Label(_('New bottle'))
        title.set_name('WineTitle')
        title.set_justify(Gtk.Justification.CENTER)
        self.add(title)

        description = Gtk.Label(_('Here you can create a new bottle'))
        description.set_name('WineDescription')
        description.set_justify(Gtk.Justification.CENTER)
        self.add(description)

        self.grid = Gtk.Grid()
        self.grid.set_column_homogeneous(True)
        self.grid.set_row_spacing(4)
        self.add(self.grid)

        prefix_name = Gtk.Label(_('Bottle name'))
        prefix_arch = Gtk.Label(_('Type (32/64)'))
        #prefix_wine = Gtk.Label("Wine version")

        self.entry_name = Gtk.Entry()
        self.entry_name.set_placeholder_text("Microsoft Office")
        #entry_name.connect("key-release-event", self.on_entry_name_key_release)
        #entry_name.connect("activate", self.on_entry_name_activate)

        self.arch_store = Gtk.ListStore(int, str)
        self.arch_store.append([0, "32 Bit"])
        self.arch_store.append([1, "64 Bit"])
        self.entry_arch = Gtk.ComboBox.new_with_model_and_entry(
            self.arch_store)
        self.entry_arch.set_entry_text_column(1)
        self.entry_arch.set_active(0)
        '''self.wine_store = Gtk.ListStore(GdkPixbuf.Pixbuf, int, str)
        for r in self.wine.list_releases("32"):
            self.wine_store.append(r)
        self.entry_wine = Gtk.ComboBox.new_with_model_and_entry(self.wine_store)
        self.entry_wine.set_entry_text_column(2)
        self.entry_wine.set_active(0)
        entry_wine_pix_render = Gtk.CellRendererPixbuf()
        self.entry_wine.pack_start(entry_wine_pix_render, False)
        self.entry_wine.add_attribute(entry_wine_pix_render, "pixbuf", 0)'''

        self.grid.add(prefix_name)
        self.grid.attach(self.entry_name, 1, 0, 2, 1)
        self.grid.attach_next_to(prefix_arch, prefix_name,
                                 Gtk.PositionType.BOTTOM, 1, 2)
        self.grid.attach_next_to(self.entry_arch, prefix_arch,
                                 Gtk.PositionType.RIGHT, 2, 1)
        '''self.grid.attach_next_to(prefix_wine, prefix_arch, Gtk.PositionType.BOTTOM, 1, 2)