HubicGTK: Check-in [b250e3bd70]

HubicGTK is a system tray icon for hubiC, the online storage service by OVH SAS.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[UPD] impersonate hubic autostart desktop file to prevent main hubic process to always autostart
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.0-alpha5 | gtk3
Files: files | file ages | folders
SHA1:b250e3bd70b1bb7d7512e69269ed4345fa7ffde7
User & Date: milouse 2016-09-06 16:38:55
Context
2016-09-06
16:44
[UPD] alpha pkgbuild check-in: 3ec4821a68 user: milouse tags: gtk3
16:38
[UPD] impersonate hubic autostart desktop file to prevent main hubic process to always autostart check-in: b250e3bd70 user: milouse tags: v1.0-alpha5, gtk3
2016-08-27
01:04
[UPD] code refactoring (uniformize quote marks) check-in: c489be0973 user: milouse tags: gtk3
Changes

Changes to hubic-gtk.py.

300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
...
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
...
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
        self.tray.set_from_icon_name('hubic-gtk-alert')
        self.tray.set_tooltip_text(HUBIC_POSSIBLE_STATUS[self.hubic_state])
        self.tray.connect('popup-menu', self.on_right_click)
        self.tray.connect('activate', self.on_left_click)

        self.last_messages = []
        self.show_messages = False
        self.must_autostart = os.path.isfile(os.path.join(xdg_config_home, 'autostart', 'hubic-gtk.desktop'))
        self.hubic_dir = ''
        self.session_bus = None

        if self.config.has_section('general'):
            self.show_messages = get_bool_conf_option(self.config, 'general', 'notify')
            self.show_all_messages = get_bool_conf_option(self.config, 'general', 'show_all_messages')

................................................................................

    # TODO check the validity of this desktop file
    def toggle_must_autostart(self, widget):
        self.must_autostart = widget.get_active()
        if not os.path.isdir(os.path.join(xdg_config_home, 'autostart')):
            self.must_autostart = False
            return False
        file_yet_exists = os.path.isfile(os.path.join(xdg_config_home, 'autostart', 'hubic-gtk.desktop'))
        if not file_yet_exists and self.must_autostart:
            with open(os.path.join(xdg_config_home, 'autostart', 'hubic-gtk.desktop'), 'w') as asfile:
                asfile.write("""[Desktop Entry]
Name=HubicGTK
Comment={}
Exec=hubic-gtk
Icon=/usr/share/icons/hicolor/128x128/hubic.png
Terminal=false
Type=Application
................................................................................
X-MATE-Autostart-enabled=true
X-GNOME-Autostart-Delay=20
StartupNotify=false
""".format(_('hubiC is an online storage platform provided by OVH. This is a status icon for it.')))
                asfile.close()

        elif file_yet_exists and not self.must_autostart:
            os.remove(os.path.join(xdg_config_home, 'autostart', 'hubic-gtk.desktop'))


    def open_parent_dir(self, widget, file_path):
        dir_open = self.get_hubic_dir()
        if os.path.isdir(file_path):
            dir_open = file_path








|







 







|

|







 







|







300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
...
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
...
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
        self.tray.set_from_icon_name('hubic-gtk-alert')
        self.tray.set_tooltip_text(HUBIC_POSSIBLE_STATUS[self.hubic_state])
        self.tray.connect('popup-menu', self.on_right_click)
        self.tray.connect('activate', self.on_left_click)

        self.last_messages = []
        self.show_messages = False
        self.must_autostart = os.path.isfile(os.path.join(xdg_config_home, 'autostart', 'hubic.desktop'))
        self.hubic_dir = ''
        self.session_bus = None

        if self.config.has_section('general'):
            self.show_messages = get_bool_conf_option(self.config, 'general', 'notify')
            self.show_all_messages = get_bool_conf_option(self.config, 'general', 'show_all_messages')

................................................................................

    # TODO check the validity of this desktop file
    def toggle_must_autostart(self, widget):
        self.must_autostart = widget.get_active()
        if not os.path.isdir(os.path.join(xdg_config_home, 'autostart')):
            self.must_autostart = False
            return False
        file_yet_exists = os.path.isfile(os.path.join(xdg_config_home, 'autostart', 'hubic.desktop'))
        if not file_yet_exists and self.must_autostart:
            with open(os.path.join(xdg_config_home, 'autostart', 'hubic.desktop'), 'w') as asfile:
                asfile.write("""[Desktop Entry]
Name=HubicGTK
Comment={}
Exec=hubic-gtk
Icon=/usr/share/icons/hicolor/128x128/hubic.png
Terminal=false
Type=Application
................................................................................
X-MATE-Autostart-enabled=true
X-GNOME-Autostart-Delay=20
StartupNotify=false
""".format(_('hubiC is an online storage platform provided by OVH. This is a status icon for it.')))
                asfile.close()

        elif file_yet_exists and not self.must_autostart:
            os.remove(os.path.join(xdg_config_home, 'autostart', 'hubic.desktop'))


    def open_parent_dir(self, widget, file_path):
        dir_open = self.get_hubic_dir()
        if os.path.isdir(file_path):
            dir_open = file_path