Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked widget to dialogs and created a brand new widget API #409

Merged
merged 3 commits into from
Oct 11, 2023
Merged

Conversation

p4p1
Copy link
Contributor

@p4p1 p4p1 commented Oct 11, 2023

Changed

  • Old havocui.Widget is not havocui.Dialog

Added

  • Created havocui.Widget to interact with the main window
  • havocui.Widget("title").setBottomTab() add the widget to the bottom tab
  • havocui.Widget("title").setSmallTab() add the widget to the small right tab
  • Added support to Calendar widget
  • Imported all of the functions from Dialog to Widget
    • addLabel
    • addButton
    • addCombobox
    • addLineedit

screenshot

image

example

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Made by papi
# Created on: Di 10 Okt 2023 01:54:42  CEST
# havoc.py
# Description:

import havocui

win = havocui.Dialog("main title")
second = havocui.Dialog("second")

third = havocui.Widget("tmp")
fourth = havocui.Widget("small")

def run_popup():
    havocui.messagebox("mdrr","content")
def print_msg():
    print("here")
def print_id(idi):
    print("num:", idi)
third.addLabel("testing")
third.addButton("popup", run_popup)
third.addCheckbox("a single checkbox", print_msg)
third.addCombobox(print_id, "option 1", "option 2", "option3")
third.addLineedit("placeholder..", print_id)
third.addCalendar(print_id)
def open_third():
    print(dir(havocui))
    third.setBottomTab()

fourth.addLabel("testing2")
fourth.addCheckbox("something", print_msg)
fourth.addCheckbox("something else", print_msg)
def open_fourth():
    fourth.setSmallTab()

def open_second():
    second.exec()
def close_second():
    second.close()
def cal_show(data):
    print(data)
second.addCalendar(cal_show)
second.addButton("close second me!", close_second)

def call_in_widget():
    print("in here")
    win.close()
def call_checkbox():
    print("checked")

def combo_box(num):
    print(num)

def process_line(string):
    print(string)

win.addLabel("This is a popup dialodjsssg")
win.addCheckbox("check me!", call_checkbox)
win.addButton("click me!", call_in_widget)
win.addCombobox(combo_box, "test", "test1", "test2")
win.addLineedit("placeholder ...", process_line)

def call_btn():
    win.exec()

havocui.createtab("Widget testing", "open widget", call_btn, "open second", open_second, "open third", open_third, "open fourth", open_fourth)

@S4ntiagoP S4ntiagoP merged commit 63f95a8 into HavocFramework:dev Oct 11, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants