Example #1
0
    def _setupUi(self):
        self.setWindowTitle(tr("Re-Prioritize duplicates"))
        self.resize(700, 400)

        # widgets
        msg = tr(
            "Add criteria to the right box and click OK to send the dupes that correspond the "
            "best to these criteria to their respective group's "
            "reference position. Read the help file for more information.")
        self.promptLabel = QLabel(msg)
        self.promptLabel.setWordWrap(True)
        self.categoryCombobox = QComboBox()
        self.criteriaListView = QListView()
        self.criteriaListView.setSelectionMode(
            QAbstractItemView.ExtendedSelection)
        self.addCriteriaButton = QPushButton(
            self.style().standardIcon(QStyle.SP_ArrowRight), "")
        self.removeCriteriaButton = QPushButton(
            self.style().standardIcon(QStyle.SP_ArrowLeft), "")
        self.prioritizationListView = QListView()
        self.prioritizationListView.setAcceptDrops(True)
        self.prioritizationListView.setDragEnabled(True)
        self.prioritizationListView.setDragDropMode(
            QAbstractItemView.InternalMove)
        self.prioritizationListView.setSelectionBehavior(
            QAbstractItemView.SelectRows)
        self.prioritizationListView.setSelectionMode(
            QAbstractItemView.ExtendedSelection)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)

        # layout
        self.mainLayout = QVBoxLayout(self)
        self.mainLayout.addWidget(self.promptLabel)
        self.splitter = QSplitter()
        sp = self.splitter.sizePolicy()
        sp.setVerticalPolicy(QSizePolicy.Expanding)
        self.splitter.setSizePolicy(sp)
        self.leftSide = QWidget()
        self.leftWidgetsLayout = QVBoxLayout()
        self.leftWidgetsLayout.addWidget(self.categoryCombobox)
        self.leftWidgetsLayout.addWidget(self.criteriaListView)
        self.leftSide.setLayout(self.leftWidgetsLayout)
        self.splitter.addWidget(self.leftSide)
        self.rightSide = QWidget()
        self.rightWidgetsLayout = QHBoxLayout()
        self.addRemoveButtonsLayout = QVBoxLayout()
        self.addRemoveButtonsLayout.addItem(verticalSpacer())
        self.addRemoveButtonsLayout.addWidget(self.addCriteriaButton)
        self.addRemoveButtonsLayout.addWidget(self.removeCriteriaButton)
        self.addRemoveButtonsLayout.addItem(verticalSpacer())
        self.rightWidgetsLayout.addLayout(self.addRemoveButtonsLayout)
        self.rightWidgetsLayout.addWidget(self.prioritizationListView)
        self.rightSide.setLayout(self.rightWidgetsLayout)
        self.splitter.addWidget(self.rightSide)
        self.mainLayout.addWidget(self.splitter)
        self.mainLayout.addWidget(self.buttonBox)
Example #2
0
    def _setupUi(self):
        self.setWindowTitle(tr("Re-Prioritize duplicates"))
        self.resize(700, 400)

        #widgets
        msg = tr(
            "Add criteria to the right box and click OK to send the dupes that correspond the "
            "best to these criteria to their respective group's "
            "reference position. Read the help file for more information."
        )
        self.promptLabel = QLabel(msg)
        self.promptLabel.setWordWrap(True)
        self.categoryCombobox = QComboBox()
        self.criteriaListView = QListView()
        self.addCriteriaButton = QPushButton(self.style().standardIcon(QStyle.SP_ArrowRight), "")
        self.removeCriteriaButton = QPushButton(self.style().standardIcon(QStyle.SP_ArrowLeft), "")
        self.prioritizationListView = QListView()
        self.prioritizationListView.setAcceptDrops(True)
        self.prioritizationListView.setDragEnabled(True)
        self.prioritizationListView.setDragDropMode(QAbstractItemView.InternalMove)
        self.prioritizationListView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)

        # layout
        self.mainLayout = QVBoxLayout(self)
        self.mainLayout.addWidget(self.promptLabel)
        self.splitter = QSplitter()
        sp = self.splitter.sizePolicy()
        sp.setVerticalPolicy(QSizePolicy.Expanding)
        self.splitter.setSizePolicy(sp)
        self.leftSide = QWidget()
        self.leftWidgetsLayout = QVBoxLayout()
        self.leftWidgetsLayout.addWidget(self.categoryCombobox)
        self.leftWidgetsLayout.addWidget(self.criteriaListView)
        self.leftSide.setLayout(self.leftWidgetsLayout)
        self.splitter.addWidget(self.leftSide)
        self.rightSide = QWidget()
        self.rightWidgetsLayout = QHBoxLayout()
        self.addRemoveButtonsLayout = QVBoxLayout()
        self.addRemoveButtonsLayout.addItem(verticalSpacer())
        self.addRemoveButtonsLayout.addWidget(self.addCriteriaButton)
        self.addRemoveButtonsLayout.addWidget(self.removeCriteriaButton)
        self.addRemoveButtonsLayout.addItem(verticalSpacer())
        self.rightWidgetsLayout.addLayout(self.addRemoveButtonsLayout)
        self.rightWidgetsLayout.addWidget(self.prioritizationListView)
        self.rightSide.setLayout(self.rightWidgetsLayout)
        self.splitter.addWidget(self.rightSide)
        self.mainLayout.addWidget(self.splitter)
        self.mainLayout.addWidget(self.buttonBox)
Example #3
0
    def _setupUi(self):
        self.setWindowTitle(tr("Preferences"))
        self.resize(332, 170)
        self.verticalLayout = QVBoxLayout(self)
        self.formLayout = QFormLayout()

        self.autoSaveIntervalSpinBox = QSpinBox(self)
        self.autoSaveIntervalSpinBox.setMaximumSize(QSize(70, 0xffffff))
        self.label_5 = QLabel(tr("minute(s) (0 for none)"), self)
        self.formLayout.addRow(
            tr("Auto-save interval:"),
            horizontalWrap([self.autoSaveIntervalSpinBox, self.label_5]))

        self.dateFormatEdit = QLineEdit(self)
        self.dateFormatEdit.setMaximumSize(QSize(140, 0xffffff))
        self.formLayout.addRow(tr("Date format:"), self.dateFormatEdit)

        self.fontSizeSpinBox = QSpinBox()
        self.fontSizeSpinBox.setMinimum(5)
        self.fontSizeSpinBox.setMaximumSize(QSize(70, 0xffffff))
        self.formLayout.addRow(tr("Font size:"), self.fontSizeSpinBox)

        self.languageComboBox = QComboBox(self)
        LANGNAMES = get_langnames()
        for lang in SUPPORTED_LANGUAGES:
            self.languageComboBox.addItem(LANGNAMES[lang])
        self.languageComboBox.setMaximumSize(QSize(140, 0xffffff))
        self.formLayout.addRow(tr("Language:"), self.languageComboBox)
        self.verticalLayout.addLayout(self.formLayout)

        self.scopeDialogCheckBox = QCheckBox(
            tr("Show scope dialog when modifying a scheduled transaction"),
            self)
        self.verticalLayout.addWidget(self.scopeDialogCheckBox)
        self.autoDecimalPlaceCheckBox = QCheckBox(
            tr("Automatically place decimals when typing"), self)
        self.verticalLayout.addWidget(self.autoDecimalPlaceCheckBox)
        self.debugModeCheckBox = QCheckBox(tr("Debug mode (restart required)"),
                                           self)
        self.verticalLayout.addWidget(self.debugModeCheckBox)
        self.verticalLayout.addItem(verticalSpacer())
        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
    def _setupUi(self):
        self.setWindowTitle(tr("Preferences"))
        self.resize(332, 170)
        self.verticalLayout = QVBoxLayout(self)
        self.formLayout = QFormLayout()

        self.autoSaveIntervalSpinBox = QSpinBox(self)
        self.autoSaveIntervalSpinBox.setMaximumSize(QSize(70, 0xffffff))
        self.label_5 = QLabel(tr("minute(s) (0 for none)"), self)
        self.formLayout.addRow(
            tr("Auto-save interval:"),
            horizontalWrap([self.autoSaveIntervalSpinBox, self.label_5])
        )

        self.dateFormatEdit = QLineEdit(self)
        self.dateFormatEdit.setMaximumSize(QSize(140, 0xffffff))
        self.formLayout.addRow(tr("Date format:"), self.dateFormatEdit)

        self.fontSizeSpinBox = QSpinBox()
        self.fontSizeSpinBox.setMinimum(5)
        self.fontSizeSpinBox.setMaximumSize(QSize(70, 0xffffff))
        self.formLayout.addRow(tr("Font size:"), self.fontSizeSpinBox)

        self.languageComboBox = QComboBox(self)
        LANGNAMES = get_langnames()
        for lang in SUPPORTED_LANGUAGES:
            self.languageComboBox.addItem(LANGNAMES[lang])
        self.languageComboBox.setMaximumSize(QSize(140, 0xffffff))
        self.formLayout.addRow(tr("Language:"), self.languageComboBox)
        self.verticalLayout.addLayout(self.formLayout)

        self.scopeDialogCheckBox = QCheckBox(tr("Show scope dialog when modifying a scheduled transaction"), self)
        self.verticalLayout.addWidget(self.scopeDialogCheckBox)
        self.autoDecimalPlaceCheckBox = QCheckBox(tr("Automatically place decimals when typing"), self)
        self.verticalLayout.addWidget(self.autoDecimalPlaceCheckBox)
        self.debugModeCheckBox = QCheckBox(tr("Debug mode (restart required)"), self)
        self.verticalLayout.addWidget(self.debugModeCheckBox)
        self.verticalLayout.addItem(verticalSpacer())
        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
Example #5
0
    def _setupUi(self):
        self.resize(400, 300)
        self.gridLayout = QGridLayout(self)
        self.label = QLabel(tr("Choose a type for this tab:"))
        self.label.setAlignment(Qt.AlignCenter)
        self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
        self.gridLayout.addItem(horizontalSpacer(), 1, 0, 1, 1)
        self.verticalLayout = QVBoxLayout()
        self.networthButton = QPushButton(tr("1. Net Worth"))
        self.networthButton.setIcon(QIcon(QPixmap(':/balance_sheet_16')))
        self.verticalLayout.addWidget(self.networthButton)
        self.profitButton = QPushButton(tr("2. Profit && Loss"))
        self.profitButton.setIcon(QIcon(QPixmap(':/income_statement_16')))
        self.verticalLayout.addWidget(self.profitButton)
        self.transactionButton = QPushButton(tr("3. Transactions"))
        self.transactionButton.setIcon(QIcon(QPixmap(':/transaction_table_16')))
        self.verticalLayout.addWidget(self.transactionButton)
        self.gledgerButton = QPushButton(tr("4. General Ledger"))
        self.gledgerButton.setIcon(QIcon(QPixmap(':/gledger_16')))
        self.verticalLayout.addWidget(self.gledgerButton)
        self.scheduleButton = QPushButton(tr("5. Schedules"))
        self.scheduleButton.setIcon(QIcon(QPixmap(':/schedules_16')))
        self.verticalLayout.addWidget(self.scheduleButton)
        self.budgetButton = QPushButton(tr("6. Budgets"))
        self.budgetButton.setIcon(QIcon(QPixmap(':/budget_16')))
        self.verticalLayout.addWidget(self.budgetButton)
        self.docpropsButton = QPushButton(tr("7. Document Properties"))
        self.docpropsButton.setIcon(QIcon(QPixmap(':/gledger_16')))
        self.verticalLayout.addWidget(self.docpropsButton)
        self.pluginLabel = QLabel(tr("Plugins (double-click to open)"))
        self.pluginLabel.setAlignment(Qt.AlignCenter)
        self.verticalLayout.addWidget(self.pluginLabel)
        self.pluginListView = QListView()
        self.pluginListView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.verticalLayout.addWidget(self.pluginListView)
        self.gridLayout.addLayout(self.verticalLayout, 1, 1, 1, 1)
        self.gridLayout.addItem(horizontalSpacer(), 1, 2, 1, 1)
        self.gridLayout.addItem(verticalSpacer(), 2, 1, 1, 1)

        for i in range(1, 8):
            shortcut = QShortcut(QKeySequence(str(i)), self, None, None, Qt.WidgetShortcut)
            setattr(self, 'shortcut{0}'.format(i), shortcut)
Example #6
0
 def _setupUi(self):
     self.resize(400, 300)
     self.gridLayout = QGridLayout(self)
     self.label = QLabel(tr("Choose a type for this tab:"))
     self.label.setAlignment(Qt.AlignCenter)
     self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
     self.gridLayout.addItem(horizontalSpacer(), 1, 0, 1, 1)
     self.verticalLayout = QVBoxLayout()
     BUTTONS = [
         ('networthButton', tr("1. Net Worth"), 'balance_sheet_16'),
         ('profitButton', tr("2. Profit && Loss"), 'income_statement_16'),
         ('transactionButton', tr("3. Transactions"),
          'transaction_table_16'),
         ('gledgerButton', tr("4. General Ledger"), 'gledger_16'),
         ('scheduleButton', tr("5. Schedules"), 'schedules_16'),
         ('budgetButton', tr("6. Budgets"), 'budget_16'),
         ('docpropsButton', tr("7. Document Properties"), 'gledger_16'),
         ('pluginlistButton', tr("8. Plugin Management"), ''),
     ]
     for i, (name, label, icon) in enumerate(BUTTONS, start=1):
         button = QPushButton(label)
         if icon:
             button.setIcon(QIcon(QPixmap(':/{}'.format(icon))))
         self.verticalLayout.addWidget(button)
         setattr(self, name, button)
         shortcut = QShortcut(self)
         shortcut.setKey(QKeySequence(str(i)))
         shortcut.setContext(Qt.WidgetShortcut)
         setattr(self, 'shortcut{}'.format(i), shortcut)
     self.pluginLabel = QLabel(tr("Plugins (double-click to open)"))
     self.pluginLabel.setAlignment(Qt.AlignCenter)
     self.verticalLayout.addWidget(self.pluginLabel)
     self.pluginListView = QListView()
     self.pluginListView.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.verticalLayout.addWidget(self.pluginListView)
     self.gridLayout.addLayout(self.verticalLayout, 1, 1, 1, 1)
     self.gridLayout.addItem(horizontalSpacer(), 1, 2, 1, 1)
     self.gridLayout.addItem(verticalSpacer(), 2, 1, 1, 1)
Example #7
0
 def _setupUi(self):
     self.resize(400, 300)
     self.gridLayout = QGridLayout(self)
     self.label = QLabel(tr("Choose a type for this tab:"))
     self.label.setAlignment(Qt.AlignCenter)
     self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
     self.gridLayout.addItem(horizontalSpacer(), 1, 0, 1, 1)
     self.verticalLayout = QVBoxLayout()
     BUTTONS = [
         ('networthButton', tr("1. Net Worth"), 'balance_sheet_16'),
         ('profitButton', tr("2. Profit && Loss"), 'income_statement_16'),
         ('transactionButton', tr("3. Transactions"), 'transaction_table_16'),
         ('gledgerButton', tr("4. General Ledger"), 'gledger_16'),
         ('scheduleButton', tr("5. Schedules"), 'schedules_16'),
         ('budgetButton', tr("6. Budgets"), 'budget_16'),
         ('docpropsButton', tr("7. Document Properties"), 'gledger_16'),
         ('pluginlistButton', tr("8. Plugin Management"), ''),
     ]
     for i, (name, label, icon) in enumerate(BUTTONS, start=1):
         button = QPushButton(label)
         if icon:
             button.setIcon(QIcon(QPixmap(':/{}'.format(icon))))
         self.verticalLayout.addWidget(button)
         setattr(self, name, button)
         shortcut = QShortcut(self)
         shortcut.setKey(QKeySequence(str(i)))
         shortcut.setContext(Qt.WidgetShortcut)
         setattr(self, 'shortcut{}'.format(i), shortcut)
     self.pluginLabel = QLabel(tr("Plugins (double-click to open)"))
     self.pluginLabel.setAlignment(Qt.AlignCenter)
     self.verticalLayout.addWidget(self.pluginLabel)
     self.pluginListView = QListView()
     self.pluginListView.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.verticalLayout.addWidget(self.pluginListView)
     self.gridLayout.addLayout(self.verticalLayout, 1, 1, 1, 1)
     self.gridLayout.addItem(horizontalSpacer(), 1, 2, 1, 1)
     self.gridLayout.addItem(verticalSpacer(), 2, 1, 1, 1)
Example #8
0
 def _setupUi(self):
     self.mainLayout = QVBoxLayout(self)
     self.label1 = QLabel("Step 1: Generate Markdown")
     self.mainLayout.addWidget(self.label1)
     self.generateMarkdownButton = QPushButton("Generate Markdown")
     self.mainLayout.addWidget(self.generateMarkdownButton)
     self.genDescLabel = QLabel()
     sizePolicy = QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Preferred)
     self.genDescLabel.setSizePolicy(sizePolicy)
     self.mainLayout.addWidget(self.genDescLabel)
     self.label2 = QLabel("Step 2: Post-processing")
     self.mainLayout.addWidget(self.label2)
     self.editMarkdownButton = QPushButton("Edit Markdown")
     self.mainLayout.addWidget(self.editMarkdownButton)
     self.revealMarkdownButton = QPushButton("Reveal Markdown")
     self.mainLayout.addWidget(self.revealMarkdownButton)
     self.viewHtmlButton = QPushButton("View HTML")
     self.mainLayout.addWidget(self.viewHtmlButton)
     self.label2 = QLabel("Step 3: E-book creation")
     self.mainLayout.addWidget(self.label2)
     self.radioLayout = QHBoxLayout()
     self.mobiRadio = QRadioButton("MOBI")
     self.radioLayout.addWidget(self.mobiRadio)
     self.epubRadio = QRadioButton("EPUB")
     self.radioLayout.addWidget(self.epubRadio)
     self.mobiRadio.setChecked(True)
     self.mainLayout.addLayout(self.radioLayout)
     self.metadataLayout = QFormLayout()
     self.metadataLayout.setFormAlignment(Qt.AlignLeft|Qt.AlignTop)
     self.titleEdit = QLineEdit()
     self.metadataLayout.addRow("Title:", self.titleEdit)
     self.authorEdit = QLineEdit()
     self.metadataLayout.addRow("Author:", self.authorEdit)
     self.mainLayout.addLayout(self.metadataLayout)
     self.createEbookButton = QPushButton("Create e-book")
     self.mainLayout.addWidget(self.createEbookButton)
     self.mainLayout.addItem(verticalSpacer())