示例#1
0
 def __init__(self):
     self._setting = UserSetting()
     self._xrandr = Xrand()
     if not self._default_profile:
         self.load_profiles()
         self.create_default_profile()
         self._current = copy.deepcopy(self._default_profile)
示例#2
0
 def init(self):
     #language label
     self._setting = UserSetting()
     self.create_label(self._('Language'), [0, 1, 0, 1],
                       self,
                       alignment='right')
     #init language comboBox
     self.language_combo_box = Gtk.ComboBox.new_with_model(
         self.create_language_list_store())
     default_position = self._setting.language_list.index(
         self._setting.language)
     self.create_combo_box(self.language_combo_box, [1, 3, 0, 1], self,
                           default_position)
     # init display link
     self.create_label(self._('Use DisplayLink'), [0, 1, 1, 2],
                       self,
                       alignment='right')
     self.create_switch_button([2, 3, 1, 2], self, self.display_link,
                               self._setting.displaylink)
     #Automatic check update
     # self.create_label(self._('Automatic update'),[0,1,1,2],self, alignment='right')
     # self.create_switch_button([2,3,1,2], self, self.automatic_check_update, self.setting['userSetting'].version['autoCheck'])
     #save
     self.create_button(self._('Save'), [2, 3, 9, 10], self,
                        self.save_setting)
示例#3
0
 def __init__(self, event_button, event_time):
     Gtk.Menu.__init__(self)
     self._profiles = Profiles()
     self._setting = UserSetting()
     self._ = self._setting.gettext
     self.init_menu()
     self.popup(None, None, None, None, event_button, event_time)
     self.show_all()
示例#4
0
 def __init__(self, parent):
     Gtk.Table.__init__(self, 10, 3, True)
     self.parent = parent
     self._setting = UserSetting()
     self._ = self._setting.gettext
     self.set_border_width(20)
     self.set_row_spacings(10)
     self.set_col_spacings(10)
     self.init()
示例#5
0
 def __init__(self):
     if not self._setting:
         Gtk.Window.__init__(self, title='Multiple Monitors')
         self._setting = UserSetting()
         self._ = self._setting.gettext
         self.set_border_width(3)
         self.notebook = Gtk.Notebook()
         self.add(self.notebook)
         self.set_default_icon_from_file(self._setting.get_icon_path())
         self.init_pages()
         self.show_all()
示例#6
0
 def init(self):
     self._setting = UserSetting()
     self._profiles = Profiles()
     self.active_monitors = []
     # initialize profile selection
     self.create_label(self._('Select profile'), [0, 1, 0, 1],
                       self,
                       alignment='right')
     self.profile_combo_box = Gtk.ComboBox.new_with_model(
         self.create_profile_list_store())
     default_position = self._profiles.get_profiles_name().index(
         self._profiles.get_current_profile_name())
     self.profile_combo_box.connect("changed", self.change_profile)
     self.create_combo_box(self.profile_combo_box, [1, 3, 0, 1], self,
                           default_position)
     # initialize monitor layout
     self.init_monitor_layout(self._profiles.get_current_profile().monitors)
     # save, delete, apply button
     self.create_button(self._('Delete'), [0, 1, 9, 10], self,
                        self.remove_profile)
     self.create_button(self._('Apply'), [1, 2, 9, 10], self,
                        self.apply_profile)
     self.create_button(self._('Save'), [2, 3, 9, 10], self,
                        self.save_profile)
 def __init__(self):
     setting = UserSetting()
     if not os.path.isdir(setting.home_dir):  # first start
         self.first_start(setting)
     self.tray = Tray()
     Gtk.main()
示例#8
0
 def init(self):
     self.set_from_file(UserSetting().get_icon_path())
     self.connect('popup-menu', self.on_right_click)
     self.connect('activate', self.on_left_click)