Skip to content

Commit f118a2a

Browse files
authored
welcome: random tips (non-obstructive)
1 parent 794d287 commit f118a2a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

plugindevtools/PluginDevTools/PluginDevToolsWidget.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,20 @@ def __init__(self):
3131
if settingsData.startswith('{'):
3232
self.settings = json.loads(settingsData)
3333

34-
34+
self.tips = [
35+
"Inspector: Right click the splitter if you want it to display vertically instead of horizontally",
36+
"Inspector: Use the Event and Signal Viewer/Debugger to latch onto signals and events, be aware some events are only visible at QApplication level so if you see events missing, change widget.installEventFilter to QApplication.installEventFilter under Events",
37+
"Inspector: Some fields like QString, bools, int, QSize and other can be modified in realtime by double clicking the value field as long as the field has a corresponding 'set', such as 'height' can be changed because 'setHeight' exists",
38+
"Console: Use your favorite text editor as your Scripter using the buttons on the top right",
39+
"To easily create a plugin with a template, go to Tools->Scripts->PluginDevTools"
40+
]
3541

3642
self.kritaAPI = {}
3743

3844
self.centralWidget = uic.loadUi(os.path.dirname(os.path.realpath(__file__)) + '/DockerWidget.ui')
39-
45+
46+
self.newTip()
47+
4048
for i in range(0,self.centralWidget.tabWidget.count()):
4149
name = self.centralWidget.tabWidget.widget(i).objectName().replace('Tab','')
4250
if name not in self.settings:
@@ -51,7 +59,8 @@ def __init__(self):
5159
self.centralWidget.tabWidget.setTabIcon( 0, Krita.instance().icon('pivot-point') )
5260
self.centralWidget.tabWidget.currentChanged.connect(self.tabChanged)
5361

54-
62+
def newTip(self):
63+
self.centralWidget.welcomeLabel.setText("Welcome to Plugin Developer Tools!\n\nRandom Tip:\n\n" + random.choice(self.tips) )
5564

5665

5766
def windowCreatedSetup(self):
@@ -91,15 +100,10 @@ class PluginDevToolsWelcome():
91100
def __init__(self, caller):
92101
super().__init__()
93102
self.caller = caller
94-
self.tips = [
95-
"Inspector: Right click the splitter if you want it to display vertically instead of horizontally",
96-
"Inspector: Use the Event and Signal Viewer/Debugger to latch onto signals and events, be aware some events are only visible at QApplication level so if you see events missing, change widget.installEventFilter to QApplication.installEventFilter under Events",
97-
"Inspector: Some fields like QString, bools, int, QSize and other can be modified in realtime by double clicking the value field as long as the field has a corresponding 'set', such as 'height' can be changed because 'setHeight' exists",
98-
"Console: Use your favorite text editor as your Scripter using the buttons on the top right"
99-
]
103+
100104

101105
def selected(self):
102-
self.caller.centralWidget.welcomeLabel.setText("Welcome to Plugin Developer Tools!\n\nRandom Tip:\n\n" + random.choice(self.tips) )
106+
self.caller.newTip()
103107
pass
104108

105109
def unselected(self):
@@ -922,7 +926,7 @@ def selected(self):
922926

923927
for action in Krita.instance().actions():
924928
parentItem.appendRow([
925-
QStandardItem( action.objectName() ),
929+
QStandardItem(action.icon(), action.objectName() ),
926930
QStandardItem( action.toolTip() )
927931
])
928932
#print ( action.objectName(), action.toolTip() )

0 commit comments

Comments
 (0)