コード例 #1
0
    def _set_config(self):
        """Method sets configuration gui

        Args:
           none

        Returns:
           void

        """

        row = 0
        font = ('Arial', 10, 'bold')
        tk.Label(self._frame_right,
                 text=self.trn.msg('htk_gitclient_repomanager_config_title'),
                 font=font).grid(row=row, column=0, sticky='w')
        tk.Label(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_config_url')).grid(
                row=row + 1, column=0, sticky='e')
        self._url = tk.Entry(self._frame_right, width=70)
        self._url.grid(row=row + 1, column=1, padx=3, pady=3, sticky='w')

        tk.Label(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_config_user')).grid(
                row=row + 2, column=0, sticky='e')
        self._user = tk.Entry(self._frame_right, width=20)
        self._user.grid(row=row + 2, column=1, padx=3, pady=3, sticky='w')

        tk.Label(self._frame_right,
                 text=self.trn.msg(
                     'htk_gitclient_repomanager_config_password')).grid(
                         row=row + 3, column=0, sticky='e')
        self._passw = tk.Entry(self._frame_right, width=20)
        self._passw.grid(row=row + 3, column=1, padx=3, pady=3, sticky='w')

        tk.Label(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_config_name')).grid(
                row=row + 4, column=0, sticky='e')
        self._name = tk.Entry(self._frame_right, width=40)
        self._name.grid(row=row + 4, column=1, padx=3, pady=3, sticky='w')

        tk.Label(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_config_email')).grid(
                row=row + 5, column=0, sticky='e')
        self._email = tk.Entry(self._frame_right, width=40)
        self._email.grid(row=row + 5, column=1, padx=3, pady=3, sticky='w')

        error = tk.Label(self._frame_right, text='', foreground='#FF0000')
        error.grid(row=row + 6, column=1, sticky='w')
        btn = tk.Button(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_config_save'),
            command=lambda: self._save_config(self._url.get(), self._user.get(
            ), self._passw.get(), self._name.get(), self._email.get(), error))
        btn.grid(row=row + 6, column=2, padx=3, pady=3, sticky='e')
コード例 #2
0
ファイル: editor.py プロジェクト: hydratk/hydratk-client
    def win_replace(self, event=None):
        """Method displays Replace window

        Args:
            event (obj): event

        Returns:
            void

        """

        tab = self.nb.get_current_tab()
        if (tab is not None):
            win = tk.Toplevel(self.root)
            win.title(self.trn.msg('htk_gui_editor_replace_title'))
            win.transient(self.root)
            win.resizable(False, False)
            win.geometry('+%d+%d' % (self.root.winfo_screenwidth() / 2,
                                     self.root.winfo_screenheight() / 2))
            win.tk.call('wm', 'iconphoto', win._w, self.root.images['logo'])

            tk.Label(win,
                     text=self.trn.msg('htk_gui_editor_replace_find')).grid(
                         row=0, column=0, sticky='e')
            find_entry = tk.Entry(win, width=50)
            find_entry.grid(row=0, column=1, padx=3, sticky='e')
            find_entry.focus_set()

            tk.Label(win,
                     text=self.trn.msg('htk_gui_editor_replace_replace')).grid(
                         row=1, column=0, pady=3, sticky='e')
            replace_entry = tk.Entry(win, width=50)
            replace_entry.grid(row=1, column=1, padx=3, sticky='e')

            replace_all = tk.BooleanVar(value=True)
            tk.Checkbutton(
                win,
                text=self.trn.msg('htk_gui_editor_replace_replace_all'),
                variable=replace_all).grid(row=2, column=1, pady=3, sticky='w')
            ignore_case = tk.BooleanVar(value=True)
            tk.Checkbutton(
                win,
                text=self.trn.msg('htk_gui_editor_replace_ignore_case'),
                variable=ignore_case).grid(row=3, column=1, sticky='w')
            regexp = tk.BooleanVar()
            tk.Checkbutton(win,
                           text=self.trn.msg('htk_gui_editor_replace_regexp'),
                           variable=regexp).grid(row=4, column=1, sticky='w')

            btn = tk.Button(
                win,
                text='OK',
                command=lambda: self._replace(find_entry.get(
                ), replace_entry.get(), replace_all.get(), ignore_case.get(),
                                              regexp.get(), win))
            btn.grid(row=0, column=2, padx=3, sticky='e')

            win.bind('<Escape>', lambda f: win.destroy())
コード例 #3
0
    def _win_clone(self):
        """Method displays clone window

        Args:
           none

        Returns:
           void

        """

        win = tk.Toplevel(self.root)
        win.title(self.trn.msg('htk_gitclient_clone_title'))
        win.transient(self.root)
        win.resizable(False, False)
        win.geometry('+%d+%d' % (self.root.winfo_screenwidth() / 3,
                                 self.root.winfo_screenheight() / 3))
        win.tk.call('wm', 'iconphoto', win._w, self.root.images['logo'])

        tk.Label(win,
                 text=self.trn.msg('htk_gitclient_clone_url')).grid(row=0,
                                                                    column=0,
                                                                    sticky='e')
        url = tk.Entry(win, width=70)
        url.grid(row=0, column=1, padx=3, pady=10, sticky='e')
        url.focus_set()

        tk.Label(win, text=self.trn.msg('htk_gitclient_clone_user')).grid(
            row=1, column=0, sticky='e')
        user = tk.Entry(win, width=20)
        user.grid(row=1, column=1, padx=3, pady=3, sticky='w')

        tk.Label(win, text=self.trn.msg('htk_gitclient_clone_password')).grid(
            row=2, column=0, sticky='e')
        passw = tk.Entry(win, width=20)
        passw.grid(row=2, column=1, padx=3, pady=3, sticky='w')

        tk.Label(win, text=self.trn.msg('htk_gitclient_clone_dirpath')).grid(
            row=3, column=0, sticky='e')
        dirpath = tk.Entry(win, width=70)
        dirpath.grid(row=3, column=1, padx=3, pady=3, sticky='w')
        tk.Button(win, text='...',
                  command=lambda: self._set_dirpath(dirpath)).grid(row=3,
                                                                   column=2,
                                                                   sticky='w')

        error = tk.Label(win, text='', foreground='#FF0000')
        error.grid(row=4, column=1, sticky='w')
        btn = tk.Button(
            win,
            text=self.trn.msg('htk_gitclient_clone_button'),
            command=lambda: self._clone_repo(url.get(), dirpath.get(
            ), user.get(), passw.get(), error, win))
        btn.grid(row=4, column=2, padx=3, pady=3, sticky='e')

        win.bind('<Escape>', lambda f: win.destroy())
コード例 #4
0
ファイル: editor.py プロジェクト: hydratk/hydratk-client
    def win_goto(self, event=None):
        """Method displays Goto window

        Args:
            event (obj): event

        Returns:
            void

        """

        tab = self.nb.get_current_tab()
        if (tab is not None):
            win = tk.Toplevel(self.root)
            win.title(self.trn.msg('htk_gui_editor_goto_title'))
            win.transient(self.root)
            win.resizable(False, False)
            win.geometry('+%d+%d' % (self.root.winfo_screenwidth() / 2,
                                     self.root.winfo_screenheight() / 2))
            win.tk.call('wm', 'iconphoto', win._w, self.root.images['logo'])

            tk.Label(win, text=self.trn.msg('htk_gui_editor_goto_text')).pack(
                side=tk.LEFT, padx=3)
            entry = tk.Entry(win, width=15)
            entry.pack(side=tk.LEFT, padx=3)
            entry.focus_set()
            btn = tk.Button(win,
                            text='OK',
                            command=lambda: self._goto(entry.get(), win))
            btn.pack(side=tk.LEFT, padx=3)

            win.bind('<Escape>', lambda f: win.destroy())
コード例 #5
0
    def _set_commit(self):
        """Method sets commit gui

        Args:
           none

        Returns:
           void

        """

        row = 7
        font = ('Arial', 10, 'bold')
        tk.Label(self._frame_right,
                 text=self.trn.msg('htk_gitclient_repomanager_commit_title'),
                 font=font).grid(row=row, column=0, sticky='w')

        tk.Label(self._frame_right,
                 text=self.trn.msg(
                     'htk_gitclient_repomanager_commit_message')).grid(
                         row=row + 1, column=0, sticky='e')
        self._msg = tk.Text(self._frame_right,
                            background='#FFFFFF',
                            height=7,
                            width=50)
        self._msg.grid(row=row + 1, column=1, rowspan=2, sticky='w')
        row += 1

        tk.Label(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_commit_author')).grid(
                row=row + 3, column=0, sticky='e')
        self._author = tk.Entry(self._frame_right, width=40)
        self._author.grid(row=row + 3, column=1, padx=3, pady=3, sticky='w')

        push = tk.BooleanVar(value=True)
        tk.Checkbutton(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_commit_push'),
            variable=push).grid(row=row + 3, column=2, sticky='e')

        error = tk.Label(self._frame_right, text='', foreground='#FF0000')
        error.grid(row=row + 4, column=1, sticky='w')
        btn = tk.Button(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_commit_commit'),
            command=lambda: self._commit(self._msg.get(
                '1.0', 'end-1c'), self._author.get(), [], push.get(), error))
        btn.grid(row=row + 4, column=2, padx=3, pady=3, sticky='e')

        tk.Label(self._frame_right,
                 text=self.trn.msg('htk_gitclient_repomanager_commit_files'),
                 font=font).grid(row=row + 5, column=0, sticky='w')

        select_all = tk.BooleanVar(value=False)
        tk.Checkbutton(
            self._frame_right,
            text=self.trn.msg('htk_gitclient_repomanager_commit_select_all'),
            variable=select_all,
            command=lambda: self._select_all_files(select_all.get())).grid(
                row=row + 6, column=1, sticky='w')

        self._files_bar = ttk.Scrollbar(self._frame_right, orient=tk.VERTICAL)
        self._files = ttk.Treeview(self._frame_right,
                                   columns=('operation', 'file'),
                                   show='tree',
                                   displaycolumns=('operation', 'file'),
                                   height=10,
                                   selectmode='browse',
                                   yscrollcommand=self._files_bar.set)
        self._files_bar.configure(command=self._files.yview)
        self._files.grid(row=row + 7, column=1, sticky=tk.NSEW)
        self._files_bar.grid(row=row + 7, column=2, sticky='nsw')

        self._files.column('#0', stretch=False, width=40)
        self._files.column('operation', stretch=False, width=50)
        self._files.column('file', stretch=True, width=200)

        self._files.bind('<ButtonRelease-1>', self._select_file)
        self._files.bind('<Any-KeyRelease>', self._select_file)