HubicGTK: Check-in [96b9116b04]

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] various improvements in dbus management
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | gtk3
Files: files | file ages | folders
SHA1:96b9116b04b0e9b07bd0242754f00e2c32a35fe0
User & Date: milouse 2016-08-15 08:29:10
Context
2016-08-15
08:29
[ADD] forgot to add necessary new icons check-in: fc75bcf863 user: milouse tags: gtk3
08:29
[UPD] various improvements in dbus management check-in: 96b9116b04 user: milouse tags: gtk3
2016-08-14
15:46
[UPD] pkgbuild to produce alpha version of hubic-gtk check-in: d7009f9643 user: milouse tags: gtk3
Changes

Changes to hubic-gtk.py.

3
4
5
6
7
8
9

10
11
12
13
14
15
16
...
144
145
146
147
148
149
150
151
152
153

154
155




156
157
158
159
160
161
162
163
164
165
166
...
170
171
172
173
174
175
176











177
178
179
180
181
182
183
...
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248

249
250
251
252
253
254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
...
282
283
284
285
286
287
288

289
290
291
292
293
294
295
296
297

298
299




300

301












302
303
304
305
306
307
308
309
310
311
312
313
314

315
316
317
318
319
320
321

322
323
324
325
326
327
328
...
360
361
362
363
364
365
366

367

368
369
370
371
372
373
374
...
378
379
380
381
382
383
384



385
386
387
388
389
390
391
...
434
435
436
437
438
439
440


441
442
443
444
445
446
447
...
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
...
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
693
...
697
698
699
700
701
702
703

704
705
706
707
708
709
710
711
712
713
714

# Icons are from: https://openclipart.org/detail/171665/nube
# Theme1 : https://openclipart.org/detail/213631/red-cloud
# Theme2 : https://openclipart.org/detail/14715/simple-weather-symbols
# Exclamation : https://openclipart.org/detail/1695/warning-sign
# Gears : https://openclipart.org/detail/256083/gears
# Arrow : https://openclipart.org/detail/198398/mono-rotate-ccw



# python stuff
import os, pwd, time, shlex
import signal, subprocess
from configparser import ConfigParser

................................................................................
            used_unit = kilo_symbol

        return (used_gibi, used_unit)



class EncfsMenu(GObject.Object):
    def __init__(self, config, hubic_dir):
        self.config = config
        self.hubic_dir = hubic_dir

        Notify.init(_('HubicGTK Secure Repositories'))






    def build_menu(self, menu):
        encfs_repos = self.config.sections()
        if len(encfs_repos) > 1:
            encfs_menu = Gtk.Menu()

            for sec in self.config.sections():
                if sec != 'general' and self.config.has_option(sec, 'mount_point'):
                    mount_point = os.path.expanduser(self.config.get(sec, 'mount_point'))
                    if subprocess.call(['grep', '-q', mount_point, '/etc/mtab']) == 0:
                        mi_button = Gtk.MenuItem.new_with_label(_('Umount {0}').format(mount_point))
................................................................................
                        mi_button.connect('activate', self.encfs_action, 'mount', sec)
                    encfs_menu.append(mi_button)

            encfs_menu_button = Gtk.MenuItem.new_with_label(_('Encrypted repositories'))
            encfs_menu_button.set_submenu(encfs_menu)
            menu.append(encfs_menu_button)













    def notify(self, msg, urgency=Notify.Urgency.NORMAL):
        nota = Notify.Notification.new(
            _('HubicGTK Secure Repositories'),
            msg
        )
        nota.set_urgency(urgency)
................................................................................
            self.notify(
                _('No config file path declared for {0}').format(section),
                Notify.Urgency.CRITICAL
            )
            return False

        encfs_config_file = os.path.expanduser(self.config.get(section, 'encfs_config'))


        if action == 'mount':
            if os.path.isdir(mount_point) and len(os.listdir(mount_point)) > 0:
                self.notify(
                    _('{0} already exists in your file system but is NOT an empty folder. Please fix it and then retry to mount {1}').format(mount_point, origin),
                    Notify.Urgency.CRITICAL
                )
................................................................................
                    self.notify(
                        _('Error while reading your password from {0}. Please check if everything is OK before retrying.').format(pass_file),
                        Notify.Urgency.CRITICAL
                    )
                    return False
            else:
                try:
                    password = subprocess.check_output(['zenity', '--password'])
                except subprocess.CalledProcessError:
                    # Nothing to do, user should have hit cancel button
                    password = ''

            password = password.strip()

            encfs_mount_cmd = 'false'
            if password != '':
                encfs_mount_cmd = 'echo "{0}" | ENCFS6_CONFIG="{1}" encfs -S "{2}" "{3}"'.format(password, encfs_config_file, origin, mount_point)

            if subprocess.call(encfs_mount_cmd, shell=True) == 0:
                self.notify(_('{0} correctly mounted').format(mount_point))

                if get_bool_conf_option(self.config, section, 'open_folder_at_mount'):
                    folder_heler = FileFolderHelper(self.config, self.hubic_dir)
                    folder_helper.open_folder(mount_point)

            else:
                self.notify(
                    _('An error occured while mounting {0}').format(mount_point),
                    Notify.Urgency.CRITICAL
                )

        else:
            if subprocess.call(['fusermount', '-u', mount_point]) == 0:
                self.notify(_('{0} successfully umounted').format(mount_point))


            else:
                self.notify(
                    _('An error occured while umounting {0}').format(mount_point),
                    Notify.Urgency.CRITICAL
                )

................................................................................
        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 = ''


        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')

            if self.config.has_option('general', 'hubic_dir'):
                self.hubic_dir = os.path.expanduser(self.config.get('general', 'hubic_dir'))

        self.ff_helper = FileFolderHelper(self.config, self.hubic_dir)


        DBusGMainLoop(set_as_default=True)




        if subprocess.call(['pgrep', '-u' + pwd.getpwuid(os.getuid())[0], '-f', 'mono.*hubiC']) == 0:

            self.initialize_dbus_infos()














    def initialize_dbus_infos(self):
        self.hubic_state = 'Starting'
        self.tray.set_from_icon_name('hubic-gtk-busy')
        self.tray.set_tooltip_text(HUBIC_POSSIBLE_STATUS[self.hubic_state])

        dbus.SystemBus().add_signal_receiver(self.on_networking_change, dbus_interface = 'org.freedesktop.NetworkManager', signal_name = 'StateChanged')

        self.session_bus = dbus.SessionBus()
        self.session_bus.add_signal_receiver(self.on_file_change, dbus_interface = 'com.hubic.account', signal_name = 'ItemChanged')
        self.session_bus.add_signal_receiver(self.on_state_change, dbus_interface = 'com.hubic.general', signal_name = 'StateChanged')
        self.session_bus.add_signal_receiver(self.on_message, dbus_interface = 'com.hubic.general', signal_name = 'Messages')


        self.hubic_account_obj = self.session_bus.get_object('com.hubiC', '/com/hubic/Account')
        self.hubic_account_iface = dbus.Interface(self.hubic_account_obj, 'com.hubic.account')
        self.hubic_general_obj = self.session_bus.get_object('com.hubiC', '/com/hubic/General')
        self.hubic_general_iface = dbus.Interface(self.hubic_general_obj, 'com.hubic.general')

        self.ff_helper.set_hubic_dir(self.get_hubic_dir())

        self.on_state_change('Starting', self.hubic_general_obj.Get('com.hubic.general', 'CurrentState'))


    def get_hubic_dir(self):
        if self.hubic_dir == '':
            self.hubic_dir = self.hubic_account_obj.Get('com.hubic.account', 'SynchronizedDir')

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


    def on_state_change(self, old_state, new_state):
        if new_state == 'NotConnected' and old_state == 'Connecting':
            self.hubic_process(None, 'stop')
            return


        self.hubic_state = new_state

        tray_tooltip = HUBIC_POSSIBLE_STATUS[self.hubic_state]
        tray_icon = 'hubic-gtk-alert'

        if self.hubic_state == 'Busy':
            tray_icon = 'hubic-gtk-busy'
            current_works = self.hubic_account_obj.Get('com.hubic.account', 'RunningOperations')

................................................................................
                    self.ff_helper.format_task(current_works[0]))

        elif self.hubic_state == 'Connecting':
            tray_icon = 'hubic-gtk-busy'

        elif self.hubic_state == 'Idle':
            tray_icon = 'hubic-gtk'




        self.tray.set_from_icon_name(tray_icon)
        self.tray.set_tooltip_text(tray_tooltip)


    def on_file_change(self, file_path):
        [status, isPublished, canBePublished] = self.hubic_account_iface.GetItemStatus(file_path)
................................................................................

    def on_backup_management(self, widget):
        subprocess.Popen(['./backup_mngt.sh'])


    def make_menu(self, event_button, event_time):
        menu = Gtk.Menu()



        current_state_info = Gtk.MenuItem.new_with_label(HUBIC_POSSIBLE_STATUS[self.hubic_state])
        current_state_info.set_sensitive(False)
        menu.append(current_state_info)

        if self.hubic_state == 'Busy' or self.hubic_state == 'Idle':
            total = self.hubic_account_obj.Get('com.hubic.account', 'TotalBytes')
................................................................................
        #menu.append(backupmgt)
        #if self.hubic_state == 'Killed':
        #    backupmgt.set_sensitive(False)
        #else:
        #    backupmgt.connect('activate', self.on_backup_management)

        # Encfs submenu
        encfs_menu = EncfsMenu(self.config, self.get_hubic_dir())
        encfs_menu.build_menu(menu)

        sep = Gtk.SeparatorMenuItem()
        menu.append(sep)

        # Launch at session start
        mi_button = Gtk.CheckMenuItem(_('Automatically start'))
        mi_button.set_active(self.must_autostart)
................................................................................
                self.initialize_dbus_infos()
            else:
                print('Dafuq did I just read?')

        else:
            if action == 'stop':
                self.hubic_general_iface.Stop()
                self.hubic_state = 'Killed'
                self.tray.set_tooltip_text(HUBIC_POSSIBLE_STATUS[self.hubic_state])
                self.tray.set_from_icon_name('hubic-gtk-alert')

            elif action == 'pause':
                self.hubic_account_iface.SetPauseState(True)

            elif action == 'resume':
                self.hubic_account_iface.SetPauseState(False)

................................................................................
            else:
                print('Dafuq did I just read?')


    def  show_about_dialog(self, widget):
        about_dialog = Gtk.AboutDialog()
        about_dialog.set_destroy_with_parent(True)
        about_dialog.set_icon_name ("HubicGTK")
        about_dialog.set_name('HubicGTK')
        about_dialog.set_website('https://projects.depar.is/hubic-gtk')
        about_dialog.set_comments(_("A status icon for hubiC on Gnu/Linux, providing an easy way to manage your encfs synchronised folders too."))
        about_dialog.set_logo(GdkPixbuf.Pixbuf.new_from_file_at_scale('/usr/share/icons/hicolor/scalable/apps/hubic-gtk.svg',
                                                                      128, 128, True))
        about_dialog.set_version(HUBIC_STATUS_VERSION)

................................................................................
        about_dialog.set_copyright(_("HubicGTK is released under the WTF public license\nStatus icons use famfamfam silk icons, released under CC By 2.5 license") + hubic_version)
        about_dialog.set_authors(['√Čtienne Deparis <etienne@depar.is>'])
        about_dialog.run()
        about_dialog.destroy()


    def kthxbye(self, widget):

        Gtk.main_quit()


if __name__ == "__main__":
    # Install signal handlers
    GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGTERM,
                         Gtk.main_quit, None)
    GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT,
                         Gtk.main_quit, None)
    SystrayIconApp()
    Gtk.main()







>







 







|


>


>
>
>
>



|







 







>
>
>
>
>
>
>
>
>
>
>







 







<







 







|












>













>







 







>









>


>
>
>
>

>
|
>
>
>
>
>
>
>
>
>
>
>
>



|
<
<







>







>







 







>
|
>







 







>
>
>







 







>
>







 







<
|







 







|
<
<







 







|







 







>











3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
...
209
210
211
212
213
214
215

216
217
218
219
220
221
222
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
...
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342


343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
...
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
...
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
...
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
...
610
611
612
613
614
615
616

617
618
619
620
621
622
623
624
...
705
706
707
708
709
710
711
712


713
714
715
716
717
718
719
...
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
...
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756

# Icons are from: https://openclipart.org/detail/171665/nube
# Theme1 : https://openclipart.org/detail/213631/red-cloud
# Theme2 : https://openclipart.org/detail/14715/simple-weather-symbols
# Exclamation : https://openclipart.org/detail/1695/warning-sign
# Gears : https://openclipart.org/detail/256083/gears
# Arrow : https://openclipart.org/detail/198398/mono-rotate-ccw
# Padlock : https://openclipart.org/detail/211857/matticonssystemlockscreen


# python stuff
import os, pwd, time, shlex
import signal, subprocess
from configparser import ConfigParser

................................................................................
            used_unit = kilo_symbol

        return (used_gibi, used_unit)



class EncfsMenu(GObject.Object):
    def __init__(self, config, hubic_dir, icon_callback):
        self.config = config
        self.hubic_dir = hubic_dir
        self.icon_callback = icon_callback
        Notify.init(_('HubicGTK Secure Repositories'))


    def set_hubic_dir(self, hubic_dir):
        self.hubic_dir = hubic_dir


    def build_menu(self, menu):
        encfs_repos = self.config.sections()
        if self.hubic_dir != '' and len(encfs_repos) > 1:
            encfs_menu = Gtk.Menu()

            for sec in self.config.sections():
                if sec != 'general' and self.config.has_option(sec, 'mount_point'):
                    mount_point = os.path.expanduser(self.config.get(sec, 'mount_point'))
                    if subprocess.call(['grep', '-q', mount_point, '/etc/mtab']) == 0:
                        mi_button = Gtk.MenuItem.new_with_label(_('Umount {0}').format(mount_point))
................................................................................
                        mi_button.connect('activate', self.encfs_action, 'mount', sec)
                    encfs_menu.append(mi_button)

            encfs_menu_button = Gtk.MenuItem.new_with_label(_('Encrypted repositories'))
            encfs_menu_button.set_submenu(encfs_menu)
            menu.append(encfs_menu_button)


    def something_is_mounted(self):
        encfs_repos = self.config.sections()
        if len(encfs_repos) > 1:
            for sec in self.config.sections():
                if sec != 'general' and self.config.has_option(sec, 'mount_point'):
                    mount_point = os.path.expanduser(self.config.get(sec, 'mount_point'))
                    if subprocess.call(['grep', '-q', mount_point, '/etc/mtab']) == 0:
                        return True
        return False


    def notify(self, msg, urgency=Notify.Urgency.NORMAL):
        nota = Notify.Notification.new(
            _('HubicGTK Secure Repositories'),
            msg
        )
        nota.set_urgency(urgency)
................................................................................
            self.notify(
                _('No config file path declared for {0}').format(section),
                Notify.Urgency.CRITICAL
            )
            return False

        encfs_config_file = os.path.expanduser(self.config.get(section, 'encfs_config'))


        if action == 'mount':
            if os.path.isdir(mount_point) and len(os.listdir(mount_point)) > 0:
                self.notify(
                    _('{0} already exists in your file system but is NOT an empty folder. Please fix it and then retry to mount {1}').format(mount_point, origin),
                    Notify.Urgency.CRITICAL
                )
................................................................................
                    self.notify(
                        _('Error while reading your password from {0}. Please check if everything is OK before retrying.').format(pass_file),
                        Notify.Urgency.CRITICAL
                    )
                    return False
            else:
                try:
                    password = subprocess.check_output(['zenity', '--password']).decode()
                except subprocess.CalledProcessError:
                    # Nothing to do, user should have hit cancel button
                    password = ''

            password = password.strip()

            encfs_mount_cmd = 'false'
            if password != '':
                encfs_mount_cmd = 'echo "{0}" | ENCFS6_CONFIG="{1}" encfs -S "{2}" "{3}"'.format(password, encfs_config_file, origin, mount_point)

            if subprocess.call(encfs_mount_cmd, shell=True) == 0:
                self.notify(_('{0} correctly mounted').format(mount_point))
                self.icon_callback('NotMounted', 'Mounted')
                if get_bool_conf_option(self.config, section, 'open_folder_at_mount'):
                    folder_heler = FileFolderHelper(self.config, self.hubic_dir)
                    folder_helper.open_folder(mount_point)

            else:
                self.notify(
                    _('An error occured while mounting {0}').format(mount_point),
                    Notify.Urgency.CRITICAL
                )

        else:
            if subprocess.call(['fusermount', '-u', mount_point]) == 0:
                self.notify(_('{0} successfully umounted').format(mount_point))
                self.icon_callback('Mounted', 'NotMounted')

            else:
                self.notify(
                    _('An error occured while umounting {0}').format(mount_point),
                    Notify.Urgency.CRITICAL
                )

................................................................................
        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')

            if self.config.has_option('general', 'hubic_dir'):
                self.hubic_dir = os.path.expanduser(self.config.get('general', 'hubic_dir'))

        self.ff_helper = FileFolderHelper(self.config, self.hubic_dir)
        self.encfs_menu = EncfsMenu(self.config, self.hubic_dir, self.on_state_change)

        DBusGMainLoop(set_as_default=True)
        self.check_for_hubic_main_process()


    def check_for_hubic_main_process(self):
        if subprocess.call(['pgrep', '-u' + pwd.getpwuid(os.getuid())[0], '-f', 'mono.*hubiC']) == 0:
            if self.session_bus == None:
                self.initialize_dbus_infos()
            self.on_state_change(self.hubic_state, self.hubic_state)
        else:
            self.cleanup_dbus_infos(None)
            self.on_state_change(self.hubic_state, 'Killed')


    def cleanup_dbus_infos(self, dbus_connection):
        if self.session_bus != None and (dbus_connection == self.session_bus or dbus_connection == None):
            self.session_bus.remove_signal_receiver(self.on_file_change, dbus_interface = 'com.hubic.account', signal_name = 'ItemChanged')
            self.session_bus.remove_signal_receiver(self.on_state_change, dbus_interface = 'com.hubic.general', signal_name = 'StateChanged')
            self.session_bus.remove_signal_receiver(self.on_message, dbus_interface = 'com.hubic.general', signal_name = 'Messages')
            self.session_bus = None


    def initialize_dbus_infos(self):
        self.on_state_change(self.hubic_state, 'Starting')



        dbus.SystemBus().add_signal_receiver(self.on_networking_change, dbus_interface = 'org.freedesktop.NetworkManager', signal_name = 'StateChanged')

        self.session_bus = dbus.SessionBus()
        self.session_bus.add_signal_receiver(self.on_file_change, dbus_interface = 'com.hubic.account', signal_name = 'ItemChanged')
        self.session_bus.add_signal_receiver(self.on_state_change, dbus_interface = 'com.hubic.general', signal_name = 'StateChanged')
        self.session_bus.add_signal_receiver(self.on_message, dbus_interface = 'com.hubic.general', signal_name = 'Messages')
        self.session_bus.call_on_disconnection(self.cleanup_dbus_infos)

        self.hubic_account_obj = self.session_bus.get_object('com.hubiC', '/com/hubic/Account')
        self.hubic_account_iface = dbus.Interface(self.hubic_account_obj, 'com.hubic.account')
        self.hubic_general_obj = self.session_bus.get_object('com.hubiC', '/com/hubic/General')
        self.hubic_general_iface = dbus.Interface(self.hubic_general_obj, 'com.hubic.general')

        self.ff_helper.set_hubic_dir(self.get_hubic_dir())
        self.encfs_menu.set_hubic_dir(self.get_hubic_dir())
        self.on_state_change('Starting', self.hubic_general_obj.Get('com.hubic.general', 'CurrentState'))


    def get_hubic_dir(self):
        if self.hubic_dir == '':
            self.hubic_dir = self.hubic_account_obj.Get('com.hubic.account', 'SynchronizedDir')

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


    def on_state_change(self, old_state, new_state):
        if new_state == 'NotConnected' and old_state == 'Connecting':
            self.hubic_process(None, 'stop')
            return

        if new_state != 'Mounted' and new_state != 'NotMounted':
            self.hubic_state = new_state

        tray_tooltip = HUBIC_POSSIBLE_STATUS[self.hubic_state]
        tray_icon = 'hubic-gtk-alert'

        if self.hubic_state == 'Busy':
            tray_icon = 'hubic-gtk-busy'
            current_works = self.hubic_account_obj.Get('com.hubic.account', 'RunningOperations')

................................................................................
                    self.ff_helper.format_task(current_works[0]))

        elif self.hubic_state == 'Connecting':
            tray_icon = 'hubic-gtk-busy'

        elif self.hubic_state == 'Idle':
            tray_icon = 'hubic-gtk'

        if self.encfs_menu.something_is_mounted():
            tray_icon += '-encfs'

        self.tray.set_from_icon_name(tray_icon)
        self.tray.set_tooltip_text(tray_tooltip)


    def on_file_change(self, file_path):
        [status, isPublished, canBePublished] = self.hubic_account_iface.GetItemStatus(file_path)
................................................................................

    def on_backup_management(self, widget):
        subprocess.Popen(['./backup_mngt.sh'])


    def make_menu(self, event_button, event_time):
        menu = Gtk.Menu()

        self.check_for_hubic_main_process()

        current_state_info = Gtk.MenuItem.new_with_label(HUBIC_POSSIBLE_STATUS[self.hubic_state])
        current_state_info.set_sensitive(False)
        menu.append(current_state_info)

        if self.hubic_state == 'Busy' or self.hubic_state == 'Idle':
            total = self.hubic_account_obj.Get('com.hubic.account', 'TotalBytes')
................................................................................
        #menu.append(backupmgt)
        #if self.hubic_state == 'Killed':
        #    backupmgt.set_sensitive(False)
        #else:
        #    backupmgt.connect('activate', self.on_backup_management)

        # Encfs submenu

        self.encfs_menu.build_menu(menu)

        sep = Gtk.SeparatorMenuItem()
        menu.append(sep)

        # Launch at session start
        mi_button = Gtk.CheckMenuItem(_('Automatically start'))
        mi_button.set_active(self.must_autostart)
................................................................................
                self.initialize_dbus_infos()
            else:
                print('Dafuq did I just read?')

        else:
            if action == 'stop':
                self.hubic_general_iface.Stop()
                self.on_state_change(self.hubic_state, 'Killed')



            elif action == 'pause':
                self.hubic_account_iface.SetPauseState(True)

            elif action == 'resume':
                self.hubic_account_iface.SetPauseState(False)

................................................................................
            else:
                print('Dafuq did I just read?')


    def  show_about_dialog(self, widget):
        about_dialog = Gtk.AboutDialog()
        about_dialog.set_destroy_with_parent(True)
        about_dialog.set_icon_name('HubicGTK')
        about_dialog.set_name('HubicGTK')
        about_dialog.set_website('https://projects.depar.is/hubic-gtk')
        about_dialog.set_comments(_("A status icon for hubiC on Gnu/Linux, providing an easy way to manage your encfs synchronised folders too."))
        about_dialog.set_logo(GdkPixbuf.Pixbuf.new_from_file_at_scale('/usr/share/icons/hicolor/scalable/apps/hubic-gtk.svg',
                                                                      128, 128, True))
        about_dialog.set_version(HUBIC_STATUS_VERSION)

................................................................................
        about_dialog.set_copyright(_("HubicGTK is released under the WTF public license\nStatus icons use famfamfam silk icons, released under CC By 2.5 license") + hubic_version)
        about_dialog.set_authors(['√Čtienne Deparis <etienne@depar.is>'])
        about_dialog.run()
        about_dialog.destroy()


    def kthxbye(self, widget):
        self.cleanup_dbus_infos(None)
        Gtk.main_quit()


if __name__ == "__main__":
    # Install signal handlers
    GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGTERM,
                         Gtk.main_quit, None)
    GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT,
                         Gtk.main_quit, None)
    SystrayIconApp()
    Gtk.main()