def __init__(self, base): Window.__init__(self, base, i18n.get('image_preview')) self.loader = BarLoadIndicator() self.view = QLabel() self.view.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) self.view.setScaledContents(True) scroll_area = QScrollArea() scroll_area.setBackgroundRole(QPalette.Dark) scroll_area.setWidget(self.view) scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.error_label = QLabel(i18n.get('error_loading_image')) self.error_label.setAlignment(Qt.AlignHCenter) self.error_label.setStyleSheet("QLabel {background-color: #ffecec;}") layout = QVBoxLayout() layout.setSpacing(0) layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.loader) layout.addWidget(self.error_label) layout.addWidget(scroll_area) self.setLayout(layout) self.__clear()
def show(self): if self.showed: self.raise_() return self.update() Window.show(self) self.showed = True
def __init__(self, base): Window.__init__(self, base, i18n.get('preferences')) self.setFixedSize(450, 360) self.current_config = self.base.get_config() self.tabbar = QTabWidget() self.tabbar.setTabsClosable(False) self.tabbar.setMovable(False) self.tabbar.setUsesScrollButtons(True) self.tabbar.setElideMode(Qt.ElideNone) self.general_page = GeneralPage(base) self.notifications_page = NotificationsPage(base) self.services_page = ServicesPage(base) self.browser_page = BrowserPage(base) self.proxy_page = ProxyPage(base) self.advanced_page = AdvancedPage(base) self.tabbar.addTab(self.general_page, i18n.get('general')) self.tabbar.addTab(self.notifications_page, i18n.get('notifications')) self.tabbar.addTab(self.services_page, i18n.get('services')) self.tabbar.addTab(self.browser_page, i18n.get('web_browser')) self.tabbar.addTab(self.proxy_page, i18n.get('proxy')) self.tabbar.addTab(self.advanced_page, i18n.get('advanced')) self.save_button = QPushButton(i18n.get('save')) self.save_button.clicked.connect(self.__on_save) self.close_button = QPushButton(i18n.get('close')) self.close_button.clicked.connect(self.__on_close) button_box = QHBoxLayout() button_box.addStretch(1) button_box.setSpacing(4) button_box.addWidget(self.close_button) button_box.addWidget(self.save_button) vbox = QVBoxLayout() vbox.addWidget(self.tabbar, 1) vbox.addLayout(button_box) vbox.setContentsMargins(10, 10, 10, 10) self.setLayout(vbox) self.show()
def __init__(self, base): Window.__init__(self, base, i18n.get('filters')) self.setFixedSize(280, 360) self.expression = QLineEdit() self.expression.returnPressed.connect(self.__new_filter) self.new_button = QPushButton(i18n.get('add_filter')) self.new_button.setToolTip(i18n.get('create_a_new_filter')) self.new_button.clicked.connect(self.__new_filter) expression_box = QHBoxLayout() expression_box.addWidget(self.expression) expression_box.addWidget(self.new_button) self.list_ = QListWidget() self.list_.clicked.connect(self.__filter_clicked) self.delete_button = QPushButton(i18n.get('delete')) self.delete_button.setEnabled(False) self.delete_button.setToolTip(i18n.get('delete_selected_filter')) self.delete_button.clicked.connect(self.__delete_filter) self.clear_button = QPushButton(i18n.get('delete_all')) self.clear_button.setEnabled(False) self.clear_button.setToolTip(i18n.get('delete_all_filters')) self.clear_button.clicked.connect(self.__delete_all) button_box = QHBoxLayout() button_box.addStretch(1) button_box.addWidget(self.clear_button) button_box.addWidget(self.delete_button) layout = QVBoxLayout() layout.addLayout(expression_box) layout.addWidget(self.list_, 1) layout.addLayout(button_box) layout.setSpacing(5) layout.setContentsMargins(5, 5, 5, 5) self.setLayout(layout) self.__update() self.show()
def __init__(self, base): Window.__init__(self, base, i18n.get("preferences")) self.setFixedSize(450, 360) self.current_config = self.base.get_config() self.tabbar = QTabWidget() self.tabbar.setTabsClosable(False) self.tabbar.setMovable(False) self.tabbar.setUsesScrollButtons(True) self.tabbar.setElideMode(Qt.ElideNone) self.general_page = GeneralPage(base) self.notifications_page = NotificationsPage(base) self.services_page = ServicesPage(base) self.browser_page = BrowserPage(base) self.proxy_page = ProxyPage(base) self.advanced_page = AdvancedPage(base) self.tabbar.addTab(self.general_page, i18n.get("general")) self.tabbar.addTab(self.notifications_page, i18n.get("notifications")) self.tabbar.addTab(self.services_page, i18n.get("services")) self.tabbar.addTab(self.browser_page, i18n.get("web_browser")) self.tabbar.addTab(self.proxy_page, i18n.get("proxy")) self.tabbar.addTab(self.advanced_page, i18n.get("advanced")) self.save_button = QPushButton(i18n.get("save")) self.save_button.clicked.connect(self.__on_save) self.close_button = QPushButton(i18n.get("close")) self.close_button.clicked.connect(self.__on_close) button_box = QHBoxLayout() button_box.addStretch(1) button_box.setSpacing(4) button_box.addWidget(self.close_button) button_box.addWidget(self.save_button) vbox = QVBoxLayout() vbox.addWidget(self.tabbar, 1) vbox.addLayout(button_box) vbox.setContentsMargins(10, 10, 10, 10) self.setLayout(vbox) self.show()
def __init__(self, base): Window.__init__(self, base, i18n.get('messages_queue')) self.setFixedSize(500, 400) self.last_timestamp = None self.showed = False self.list_ = QTableView() self.list_.setSelectionBehavior(QAbstractItemView.SelectRows) self.list_.clicked.connect(self.__account_clicked) self.caption = QLabel() self.caption.setWordWrap(True) self.caption.setAlignment(Qt.AlignCenter) self.estimated_time = QLabel() self.estimated_time.setWordWrap(True) self.estimated_time.setAlignment(Qt.AlignCenter) self.delete_button = QPushButton(i18n.get('delete')) self.delete_button.setEnabled(False) self.delete_button.setToolTip(i18n.get('delete_selected_message')) self.delete_button.clicked.connect(self.__delete_message) self.clear_button = QPushButton(i18n.get('delete_all')) self.clear_button.setEnabled(False) self.clear_button.setToolTip(i18n.get('delete_all_messages_in_queue')) self.clear_button.clicked.connect(self.__delete_all) button_box = QHBoxLayout() button_box.addStretch(1) button_box.addWidget(self.clear_button) button_box.addWidget(self.delete_button) layout = QVBoxLayout() layout.addWidget(self.list_, 1) layout.addWidget(self.caption) layout.addWidget(self.estimated_time) layout.addLayout(button_box) layout.setSpacing(5) layout.setContentsMargins(5, 5, 5, 5) self.setLayout(layout)
def __init__(self, base): Window.__init__(self, base, i18n.get('user_profile')) self.account_id = None self.setFixedSize(380, 450) self.username = QLabel('') self.username.setTextFormat(Qt.RichText) self.fullname = QLabel('') self.options = ImageButton(base, 'action-status-menu.png', i18n.get('')) self.options.clicked.connect(self.__options_clicked) self.verified_icon = QLabel() self.verified_icon.setPixmap(base.load_image('mark-verified.png', True)) self.protected_icon = QLabel() self.protected_icon.setPixmap( base.load_image('mark-protected.png', True)) self.avatar = ClickableLabel() self.avatar.setPixmap(base.load_image('unknown.png', True)) self.avatar.clicked.connect(self.__show_avatar) self.you_label = QLabel(i18n.get('this_is_you')) self.you_label.setVisible(False) info_line1 = QHBoxLayout() info_line1.setSpacing(5) info_line1.addWidget(self.username) info_line1.addSpacing(5) info_line1.addWidget(self.verified_icon) info_line1.addWidget(self.protected_icon) info_line1.addStretch(0) info_line2 = QHBoxLayout() info_line2.addWidget(self.fullname, 1) info_line2.addWidget(self.options) info_line2.addWidget(self.you_label) user_info = QVBoxLayout() user_info.addLayout(info_line1) user_info.addLayout(info_line2) self.loader = BarLoadIndicator() self.loader.setVisible(False) self.error_message = ErrorLabel() self.error_message.setVisible(False) header = QHBoxLayout() header.setContentsMargins(5, 10, 5, 0) header.addWidget(self.avatar) header.addSpacing(10) header.addLayout(user_info) # User Info self.bio = UserField(base, 'bio', 'icon-bio.png') self.bio.set_word_wrap(True) self.bio.set_info('') self.location = UserField(base, 'location', 'icon-location.png') self.location.set_info('') self.web = UserField(base, 'web', 'icon-home.png') self.web.set_info('') self.tweets = StatInfoBox('tweets', '') self.following = StatInfoBox('following', '') self.followers = StatInfoBox('followers', '') self.favorites = StatInfoBox('favorites', '') footer_layout = QHBoxLayout() footer_layout.setContentsMargins(0, 5, 0, 10) footer_layout.setSpacing(0) footer_layout.addLayout(self.tweets) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.following) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.followers) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.favorites) footer = QWidget() footer.setLayout(footer_layout) footer.setStyleSheet( "QWidget { background-color: #333; color: white; }") body_layout = QVBoxLayout() body_layout.setSpacing(15) body_layout.setContentsMargins(0, 0, 0, 0) body_layout.addLayout(self.bio) body_layout.addLayout(self.location) body_layout.addLayout(self.web) body_layout.addWidget(footer) body = QWidget() body.setLayout(body_layout) self.last_statuses = StatusesColumn(self.base, None, False) self.tabs = QTabWidget(self) self.tabs.setTabsClosable(False) self.tabs.setMovable(False) self.tabs.addTab(body, i18n.get('info')) self.tabs.addTab(self.last_statuses, i18n.get('recent')) self.hline = HLine() self.hline.setMinimumHeight(2) layout = QVBoxLayout() layout.addLayout(header) layout.addSpacing(10) layout.addWidget(self.hline) layout.addWidget(self.loader) layout.addWidget(self.error_message) layout.addSpacing(10) layout.addWidget(self.tabs, 1) layout.setSpacing(0) layout.setContentsMargins(5, 5, 5, 5) self.setLayout(layout) self.__clear()
def __init__(self, base): Window.__init__(self, base, i18n.get('user_profile')) self.account_id = None self.setFixedSize(380, 450) self.username = QLabel('') self.username.setTextFormat(Qt.RichText) self.fullname = QLabel('') self.options = ImageButton(base, 'action-status-menu.png', i18n.get('')) self.options.clicked.connect(self.__options_clicked) self.verified_icon = QLabel() self.verified_icon.setPixmap(base.load_image('mark-verified.png', True)) self.protected_icon = QLabel() self.protected_icon.setPixmap(base.load_image('mark-protected.png', True)) self.avatar = ClickableLabel() self.avatar.setPixmap(base.load_image('unknown.png', True)) self.avatar.clicked.connect(self.__show_avatar) self.you_label = QLabel(i18n.get('this_is_you')) self.you_label.setVisible(False) info_line1 = QHBoxLayout() info_line1.setSpacing(5) info_line1.addWidget(self.username) info_line1.addSpacing(5) info_line1.addWidget(self.verified_icon) info_line1.addWidget(self.protected_icon) info_line1.addStretch(0) info_line2 = QHBoxLayout() info_line2.addWidget(self.fullname, 1) info_line2.addWidget(self.options) info_line2.addWidget(self.you_label) user_info = QVBoxLayout() user_info.addLayout(info_line1) user_info.addLayout(info_line2) self.loader = BarLoadIndicator() self.loader.setVisible(False) self.error_message = ErrorLabel() self.error_message.setVisible(False) header = QHBoxLayout() header.setContentsMargins(5, 10, 5, 0) header.addWidget(self.avatar) header.addSpacing(10) header.addLayout(user_info) # User Info self.bio = UserField(base, 'bio', 'icon-bio.png') self.bio.set_word_wrap(True) self.bio.set_info('') self.location = UserField(base, 'location', 'icon-location.png') self.location.set_info('') self.web = UserField(base, 'web', 'icon-home.png') self.web.set_info('') self.tweets = StatInfoBox('tweets', '') self.following = StatInfoBox('following', '') self.followers = StatInfoBox('followers', '') self.favorites = StatInfoBox('favorites', '') footer_layout = QHBoxLayout() footer_layout.setContentsMargins(0, 5, 0, 10) footer_layout.setSpacing(0) footer_layout.addLayout(self.tweets) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.following) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.followers) footer_layout.addWidget(VLine()) footer_layout.addLayout(self.favorites) footer = QWidget() footer.setLayout(footer_layout) footer.setStyleSheet("QWidget { background-color: #333; color: white; }") body_layout = QVBoxLayout() body_layout.setSpacing(15) body_layout.setContentsMargins(0, 0, 0, 0) body_layout.addLayout(self.bio) body_layout.addLayout(self.location) body_layout.addLayout(self.web) body_layout.addWidget(footer) body = QWidget() body.setLayout(body_layout) self.last_statuses = StatusesColumn(self.base, None, False) self.tabs = QTabWidget(self) self.tabs.setTabsClosable(False) self.tabs.setMovable(False) self.tabs.addTab(body, i18n.get('info')) self.tabs.addTab(self.last_statuses, i18n.get('recent')) self.hline = HLine() self.hline.setMinimumHeight(2) layout = QVBoxLayout() layout.addLayout(header) layout.addSpacing(10) layout.addWidget(self.hline) layout.addWidget(self.loader) layout.addWidget(self.error_message) layout.addSpacing(10) layout.addWidget(self.tabs, 1) layout.setSpacing(0) layout.setContentsMargins(5, 5, 5, 5) self.setLayout(layout) self.__clear()